Skip to content

Commit 3f41560

Browse files
committed
Bring AsciiMath up to version 2.0.1 (by modifying two lines in the 1.4.7 version)
1 parent 4d61d19 commit 3f41560

File tree

6 files changed

+20
-6
lines changed

6 files changed

+20
-6
lines changed

config/AM_HTMLorMML-full.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/AM_HTMLorMML.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/TeX-MML-AM_HTMLorMML-full.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/TeX-MML-AM_HTMLorMML.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jax/input/AsciiMath/jax.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unpacked/jax/input/AsciiMath/jax.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@
171171

172172
var navigator = {appName: "MathJax"}; // hide the true navigator object
173173

174+
var i; // avoid global variable used in code below
174175

175176
/******************************************************************
176177
*
@@ -182,6 +183,11 @@
182183
* A few items are commented out and marked with DPVC comments
183184
* in order to keep the minifier from complaining about the
184185
* coding practices in ASCIIMathML.js
186+
*
187+
* Two sections are modified to include changes from version 2.0.1 of
188+
* ASCIIMathML.js and are marked with comments to that effect. This
189+
* makes this version effectively the same as version 2.0.1, but
190+
* without the overhead of the LaTeX-processing code.
185191
*
186192
******************************************************************/
187193

@@ -542,6 +548,10 @@ function AMcreateMmlNode(t,frag) {
542548
function newcommand(oldstr,newstr) {
543549
AMsymbols = AMsymbols.concat([{input:oldstr, tag:"mo", output:newstr,
544550
tex:null, ttype:DEFINITION}]);
551+
// #### Added from Version 2.0.1 #### //
552+
AMsymbols.sort(compareNames);
553+
for (i=0; i<AMsymbols.length; i++) AMnames[i] = AMsymbols[i].input;
554+
// #### End of Addition #### //
545555
}
546556

547557
function AMremoveCharsAndBlanks(str,n) {
@@ -625,8 +635,12 @@ function AMgetSymbol(str) {
625635
st = str.slice(0,1); //take 1 character
626636
tagst = (("A">st || st>"Z") && ("a">st || st>"z")?"mo":"mi");
627637
}
628-
if (st=="-" && AMpreviousSymbol==INFIX)
638+
// #### Replaced by lines from Version 2.0.1 #### //
639+
if (st=="-" && AMpreviousSymbol==INFIX) {
640+
AMcurrentSymbol = INFIX; //trick "/" into recognizing "-" on second parse
629641
return {input:st, tag:tagst, output:st, ttype:UNARY, func:true};
642+
}
643+
// #### End of Replacement #### //
630644
return {input:st, tag:tagst, output:st, ttype:CONST};
631645
}
632646

0 commit comments

Comments
 (0)