Last modified: 2013-04-28 23:20:16 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T43677, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 41677 - MathJax displays raw HTML for <math> inside attributes
MathJax displays raw HTML for <math> inside attributes
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Math (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-02 08:26 UTC by Michael M.
Modified: 2013-04-28 23:20 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Michael M. 2012-11-02 08:26:00 UTC
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

<spanclass="tex"dir="ltr">$x2$</span>

In PNG-mode the output looks correct.
Comment 1 Derk-Jan Hartman 2012-11-02 10:54:28 UTC
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="//upload.wikimedia.org/math/c/6/6/c66452631491acdbf8e5ed69dfd19681.png"></span>
Comment 2 Michael M. 2012-11-02 11:55:48 UTC
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.
Comment 3 Gerrit Notification Bot 2013-04-28 09:57:06 UTC
Related URL: https://gerrit.wikimedia.org/r/61252 (Gerrit Change I997fc5e87b320879c99f7560fb023876ab6ef573)
Comment 4 Gerrit Notification Bot 2013-04-28 12:10:13 UTC
https://gerrit.wikimedia.org/r/61252 (Gerrit Change I997fc5e87b320879c99f7560fb023876ab6ef573) | change APPROVED and MERGED [by jenkins-bot]

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links