Fix texClass for <mo> elements that should be class OP, and make ^ and + be stretchy accents in infix mode

This commit is contained in:
Davide P. Cervone 2012-01-16 15:44:02 -05:00
parent d2bf4e3bb5
commit 2a9287b06a
10 changed files with 19 additions and 9 deletions

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -541,6 +541,9 @@ MathJax.ElementJax.mml.Augment({
var def = MathJax.Hub.Insert({},data[3]);
def.lspace = this.SPACE[data[0]]; def.rspace = this.SPACE[data[1]];
def.texClass = data[2];
if (def.texClass === MML.TEXCLASS.REL &&
(this.movablelimits || this.data.join("").match(/^[a-z]+$/i)))
{def.texClass = MML.TEXCLASS.OP} // mark named operators as OP
return def;
},
getForm: function () {
@ -1583,6 +1586,13 @@ MathJax.ElementJax.mml.Augment({
OPTYPES: MO
});
//
// These are not in the W3C table, but FF works this way,
// and it makes sense, so add it here
//
MML.mo.prototype.OPTABLE.infix["^"] = MO.WIDEREL;
MML.mo.prototype.OPTABLE.infix["_"] = MO.WIDEREL;
})(MathJax.ElementJax.mml);
MathJax.ElementJax.mml.loadComplete("jax.js");