RCE breaking LaTeX expression entered into a page if you view the page in HTML mode and other misbehavior

maguire
Community Champion

If one enters the equation that @James used in https://community.canvaslms.com/t5/Canvas-Question-Forum/What-is-latest-Update-on-LaTeX-accessibilit...

Directly into RCE with

\ (\small{(x+1)^{10}=x^{10}+20x^9+180x^8+960x^7+3360x^6+8064x^5+13440x^4+15360x^3+11520x^2+5120x+1024}\ )

rather than using the RCE equation editor. [The space after the \ is to avoid the expression being converted in this message.]

When you save the page - it will now display properly with MathJax.

However, if you edit the page and go to RCE's HTML view you will see

 <p>(x+1)10=x10+20x9+180x8+960x7+3360x6+8064x5+13440x4+15360x3+11520x2+5120x+1024\small{(x+1)^{10}=x^{10}+20x^9+180x^8+960x^7+3360x^6+8064x^5+13440x^4+15360x^3+11520x^2+5120x+1024}</p>

If you now go back to the regular view, you see the text and the LaTeX - but the \( and \) have been removed! Definitely not the expected behavior. 

This seems to be a problem due to RCE misbehavior.

Additionally, if you enter in HTML mode using RCE unicode strings such as the following:

<p><span>&#x1D49C;&#xFE00;</span> chancery style; # MATHEMATICAL SCRIPT CAPITAL A &#x1D49C;</p>
<p><span>&#x1D49C;&#xFE01;</span> roundhand style; # MATHEMATICAL SCRIPT CAPITAL A &#x1D49C;</p>
<p><span>&#x2131;&#xFE00;</span> chancery style; # MATHEMATICAL SCRIPT CAPITAL F &#x2131;</p>
<p><span>&#x2131;&#xFE01;</span> roundhand style; # MATHEMATICAL SCRIPT CAPITAL F &#x2131;</p>

When you exit HTML mode, RCE removes the variation selectors and just puts the letter in. However, you now do not have the variant of the character that you expected. If you now go to HTML mode, you see the character and not the &#x1D49C; or &#x2131; and the variation selectors are all gone.

Being unable to specify the variation leads to very peculiar behaviors where the same character will be rendered in different ways in different places in the content! This is because the browser is trying to guess which variant to display. In LaTeX notation, the character you would expect from \mathcal{L} can become the character generated by \mathscr{L].

Has anyone else seen these (mis-)behaviors?

Labels (2)