Make pre- and postfilters backward compatible, and allow them to be replaced by Augment()
This commit is contained in:
parent
ad08117628
commit
e29ddd477d
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1898,15 +1898,16 @@
|
||||||
data.math = mml; this.postfilterHooks.Execute(data);
|
data.math = mml; this.postfilterHooks.Execute(data);
|
||||||
return data.math;
|
return data.math;
|
||||||
},
|
},
|
||||||
prefilterMath: function (data) {
|
prefilterMath: function (math,displaystyle,script) {
|
||||||
// Konqueror incorrectly quotes these characters in script.innerHTML
|
// Konqueror incorrectly quotes these characters in script.innerHTML
|
||||||
if (HUB.Browser.isKonqueror)
|
if (HUB.Browser.isKonqueror)
|
||||||
{data.math = data.math.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}
|
{math = math.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}
|
||||||
// avoid parsing super- and subscript numbers as a unit
|
// avoid parsing super- and subscript numbers as a unit
|
||||||
data.math = data.math.replace(/([_^]\s*\d)([0-9.,])/g,"$1 $2");
|
return math.replace(/([_^]\s*\d)([0-9.,])/g,"$1 $2");
|
||||||
},
|
},
|
||||||
postfilterMath: function (data) {
|
postfilterMath: function (math,displaystyle,script) {
|
||||||
this.combineRelations(data.math.root);
|
this.combineRelations(math.root);
|
||||||
|
return math;
|
||||||
},
|
},
|
||||||
formatError: function (err,math,display,script) {
|
formatError: function (err,math,display,script) {
|
||||||
return MML.merror(err.message.replace(/\n.*/,""));
|
return MML.merror(err.message.replace(/\n.*/,""));
|
||||||
|
@ -1959,8 +1960,14 @@
|
||||||
//
|
//
|
||||||
// Add the default filters
|
// Add the default filters
|
||||||
//
|
//
|
||||||
TEX.prefilterHooks.Add(["prefilterMath",TEX]);
|
TEX.prefilterHooks.Add(function (data) {
|
||||||
TEX.postfilterHooks.Add(["postfilterMath",TEX]);
|
data.math = TEX.prefilterMath(data.math,data.displaystyle,data.script);
|
||||||
|
});
|
||||||
|
TEX.postfilterHooks.Add(function (data) {
|
||||||
|
data.math = TEX.postfilterMath(data.math,data.displaystyle,data.script);
|
||||||
|
});
|
||||||
|
// TEX.prefilterHooks.Add(["prefilterMath",TEX]);
|
||||||
|
// TEX.postfilterHooks.Add(["postfilterMath",TEX]);
|
||||||
|
|
||||||
TEX.loadComplete("jax.js");
|
TEX.loadComplete("jax.js");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user