Update use of RegExp.$n to account for Firefoxs change from empty string to undefined for unmatched groups. Resolves issue #891.
This commit is contained in:
parent
3ca32dc64b
commit
b33ed4c54b
|
@ -91,7 +91,7 @@ MathJax.Hub.Register.LoadHook("[MathJax]/jax/element/mml/jax.js",function () {
|
|||
if (typeof(value) === "string" &&
|
||||
value.replace(/ /g,"").match(/^(([-+])?(\d+(\.\d*)?|\.\d+))mu$/)) {
|
||||
// FIXME: should take scriptlevel into account
|
||||
return RegExp.$2+((1/18)*RegExp.$3).toFixed(3).replace(/\.?0+$/,"")+"em";
|
||||
return (RegExp.$2||"")+((1/18)*RegExp.$3).toFixed(3).replace(/\.?0+$/,"")+"em";
|
||||
}
|
||||
else if (this.toMathMLvariants[value]) {return this.toMathMLvariants[value]}
|
||||
return this.toMathMLquote(value);
|
||||
|
|
|
@ -167,7 +167,7 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
|
|||
var Y, fY, n = "";
|
||||
if (typeof(values.align) !== "string") {values.align = String(values.align)}
|
||||
if (values.align.match(/(top|bottom|center|baseline|axis)( +(-?\d+))?/))
|
||||
{n = RegExp.$3; values.align = RegExp.$1} else {values.align = this.defaults.align}
|
||||
{n = RegExp.$3||""; values.align = RegExp.$1} else {values.align = this.defaults.align}
|
||||
if (n !== "") {
|
||||
//
|
||||
// Find the height of the given row
|
||||
|
|
|
@ -518,7 +518,7 @@
|
|||
value = String(value);
|
||||
if (nMML.NAMEDSPACE[value]) {value = nMML.NAMEDSPACE[value]} // MP doesn't do negative spaces
|
||||
else if (value.match(/^\s*(([-+])?(\d+(\.\d*)?|\.\d+))\s*mu\s*$/))
|
||||
{value = RegExp.$2+((1/18)*RegExp.$3).toFixed(3).replace(/\.?0+$/,"")+"em"} // FIXME: should take scriptlevel into account
|
||||
{value = (RegExp.$2||"")+((1/18)*RegExp.$3).toFixed(3).replace(/\.?0+$/,"")+"em"} // FIXME: should take scriptlevel into account
|
||||
else if (this.NativeMMLvariants[value]) {value = this.NativeMMLvariants[value]}
|
||||
return value;
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user