commit 779be27960023151f84ddf35b97fc430013e4540
parent c4da088220929b63af5e36915f1225d24706df14
Author: Davide P. Cervone <dpvc@union.edu>
Date: Wed, 17 Apr 2013 07:36:28 -0400
Process \$ in \text arguements. Resolves issue #349.
Diffstat:
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/unpacked/jax/input/TeX/config.js b/unpacked/jax/input/TeX/config.js
@@ -24,7 +24,7 @@
MathJax.InputJax.TeX = MathJax.InputJax({
id: "TeX",
- version: "2.1.2",
+ version: "2.1.3",
directory: MathJax.InputJax.directory + "/TeX",
extensionDir: MathJax.InputJax.extensionDir + "/TeX",
diff --git a/unpacked/jax/input/TeX/jax.js b/unpacked/jax/input/TeX/jax.js
@@ -1899,7 +1899,7 @@
InternalMath: function (text,level) {
var def = {displaystyle: false}; if (level != null) {def.scriptlevel = level}
if (this.stack.env.font) {def.mathvariant = this.stack.env.font}
- if (!text.match(/\$|\\\(|\\(eq)?ref\s*\{/)) {return [this.InternalText(text,def)]}
+ if (!text.match(/\\?\$|\\\(|\\(eq)?ref\s*\{/)) {return [this.InternalText(text,def)]}
var i = 0, k = 0, c, match = '';
var mml = [];
while (i < text.length) {
@@ -1927,6 +1927,8 @@
} else if (c === ')' && match === ')') {
mml.push(MML.TeXAtom(TEX.Parse(text.slice(k,i-2),{}).mml().With(def)));
match = ''; k = i;
+ } else if (c === '$' && match === '') {
+ i--; text = text.substr(0,i-1) + text.substr(i); // remove \ from \$
}
}
}