Page MenuHomePhabricator

MathJax displays raw HTML for <math> inside attributes
Closed, ResolvedPublic


Test the following code with MathJax:

<span title="<math>x^2</math>"><math>x^2</math></span>

[Q: Why should anyone put <math> inside a title attribute?
A: Some templates for citing books use micro-formats, so this

actually does happen.]

This is shown as


In PNG-mode the output looks correct.

Version: unspecified
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:05 AM
bzimport added a project: Math.
bzimport set Reference to bz41677.
bzimport added a subscriber: Unknown Object (MLST).

After Math extensions parser hook, the output becomes:

<span class="tex"><span class="tex" dir="ltr">$ x^2 $</span></span>

possibly there is some Tidy cleanup going on as well. This might 'work' with image mode, but such is pure accidental:

PNG mode:
<span class="tex"><img class="tex hide-images-handled" alt="x^2" src="//"></span>

What about using $(node).text() instead of node.innerHTML in the ConvertMath function in modules/MathJax/extensions/wiki2jax.js? That way it should at least display correctly.

Related URL: (Gerrit Change I997fc5e87b320879c99f7560fb023876ab6ef573) (Gerrit Change I997fc5e87b320879c99f7560fb023876ab6ef573) | change APPROVED and MERGED [by jenkins-bot]