mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-12-23 21:02:51 +00:00
(bug 36855) escape literal % in tex input
This removes support for MathML % comments, just as with texvc PS2: Fix for regex lookbehind issue Change-Id: I0cb026d749733ed3dbba8faacb163be4438fc6bb
This commit is contained in:
parent
7b2b7301e0
commit
7e58acc95a
3
modules/MathJax/extensions/wiki2jax.js
vendored
3
modules/MathJax/extensions/wiki2jax.js
vendored
|
@ -39,6 +39,9 @@ MathJax.Extension.wiki2jax = {
|
|||
tex = tex.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/ /g," ");
|
||||
}
|
||||
|
||||
// We don't allow comments (%) in texvc and escape all literal % by default.
|
||||
tex = tex.replace(/([^\\])%/g, "$1\\%" );
|
||||
|
||||
tex = tex.replace(/\\iiint([^!]*)!\\!\\!\\!\\!.*\\subset\\!\\supset/g,"\\iiint$1mkern-2.5em\\subset\\!\\supset").replace(/\\iint([^!]*)!\\!\\!\\!\\!\\!\\!\\!\\!\\!\\!(.*)\\subset\\!\\supset/g,"\\iint$1mkern-1.65em$2\\subset\\!\\!\\supset").replace(/\\int\\!\\!\\!(\\!)+\\int\\!\\!\\!(\\!)+\\int([^!]*)!\\!\\!\\!\\!.*\\bigcirc(\\,)*/g,"\\iiint$3mkern-2.5em\\subset\\!\\supset").replace(/\\int\\!\\!\\!(\\!)+\\int([^!]*)!\\!\\!\\!\\!\\!\\!\\!\\!(.*)\\bigcirc(\\,)*/g,"\\iint$2mkern-1.65em$3\\subset\\!\\!\\supset");
|
||||
if (mode === "") {
|
||||
tex = tex.replace(/ *\\scriptstyle(\W)/g,"\\textstyle$1").replace(/ *\\scriptscriptstyle(\W)/g,"\\scriptstyle$1");
|
||||
|
|
Loading…
Reference in a new issue