I'm experiencing an issue with the RadEditor displaying MathML code in Design mode rather than the corresponding symbol. This only happens when the MathML code includes attributes such as font family or table alignment. At first the MathML code was being truncated when encountering single quotes used in the attributes. So I added a line of code to perform string replace() method replacing single quotes with the corresponding URL encoding of %60. Ultimately the string gets created into an image which is displayed in Design mode of the RadEditor. As a side note, the website uses the MathFlow applet from DesignScience.
Here's the HTML code for a solid triangle, which displays the symbol correctly in Design mode:
<img alt="%3Cmath%3E%3Cmrow%3E%3Cmo%3E%26utrif;%3C/mo%3E%3C/mrow%3E%3C/math%3E" src="/TestDevelopment/displayMathML.aspx?MathML=%3Cmath%3E%3Cmrow%3E%3Cmo%3E%26utrif;%3C/mo%3E%3C/mrow%3E%3C/math%3E" title="%3Cmath%3E%3Cmrow%3E%3Cmo%3E%26utrif;%3C/mo%3E%3C/mrow%3E%3C/math%3E" />
Here's the HTML code for a triangle, which does not display the symbol in Design mode, but rather the value of the 'alt' attribute:
<img alt="%3Cmath%3E%3Cmrow%3E%3Cmo%20fontfamily%3D%60MS%20Mincho%60%3E%26xutri;%3C/mo%3E%3C/mrow%3E%3C/math%3E" src="/TestDevelopment/displayMathML.aspx?MathML=%3Cmath%3E%3Cmrow%3E%3Cmo%20fontfamily%3D%60MS%20Mincho%60%3E%26xutri;%3C/mo%3E%3C/mrow%3E%3C/math%3E" title="%3Cmath%3E%3Cmrow%3E%3Cmo%20fontfamily%3D%60MS%20Mincho%60%3E%26xutri;%3C/mo%3E%3C/mrow%3E%3C/math%3E" />
If I remove the fontfamily attribute from 'src' in the line of code above then the triangle symbol will display correctly in Design mode.
So I'm guessing there is something wrong with the way the URL is formed, just not sure what. ;-) The MathFlow API has a method which returns a string containing URL-encoded packed MathML markup for the current equation, which includes escaping some of the characters such as the angle brackets, ampersand, etc., however the method does not handle escaping single quotes.
Any thoughts or ideas about how to get this working properly would be greatly appreciated!!!
Here's the HTML code for a solid triangle, which displays the symbol correctly in Design mode:
<img alt="%3Cmath%3E%3Cmrow%3E%3Cmo%3E%26utrif;%3C/mo%3E%3C/mrow%3E%3C/math%3E" src="/TestDevelopment/displayMathML.aspx?MathML=%3Cmath%3E%3Cmrow%3E%3Cmo%3E%26utrif;%3C/mo%3E%3C/mrow%3E%3C/math%3E" title="%3Cmath%3E%3Cmrow%3E%3Cmo%3E%26utrif;%3C/mo%3E%3C/mrow%3E%3C/math%3E" />
Here's the HTML code for a triangle, which does not display the symbol in Design mode, but rather the value of the 'alt' attribute:
<img alt="%3Cmath%3E%3Cmrow%3E%3Cmo%20fontfamily%3D%60MS%20Mincho%60%3E%26xutri;%3C/mo%3E%3C/mrow%3E%3C/math%3E" src="/TestDevelopment/displayMathML.aspx?MathML=%3Cmath%3E%3Cmrow%3E%3Cmo%20fontfamily%3D%60MS%20Mincho%60%3E%26xutri;%3C/mo%3E%3C/mrow%3E%3C/math%3E" title="%3Cmath%3E%3Cmrow%3E%3Cmo%20fontfamily%3D%60MS%20Mincho%60%3E%26xutri;%3C/mo%3E%3C/mrow%3E%3C/math%3E" />
If I remove the fontfamily attribute from 'src' in the line of code above then the triangle symbol will display correctly in Design mode.
So I'm guessing there is something wrong with the way the URL is formed, just not sure what. ;-) The MathFlow API has a method which returns a string containing URL-encoded packed MathML markup for the current equation, which includes escaping some of the characters such as the angle brackets, ampersand, etc., however the method does not handle escaping single quotes.
Any thoughts or ideas about how to get this working properly would be greatly appreciated!!!