Skip to content

Commit

Permalink
Bring AsciiMath up to version 2.0.1 (by modifying two lines in the 1.…
Browse files Browse the repository at this point in the history
…4.7 version)
  • Loading branch information
dpvc committed Feb 26, 2012
1 parent 4d61d19 commit 3f41560
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config/AM_HTMLorMML-full.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion config/AM_HTMLorMML.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion config/TeX-MML-AM_HTMLorMML-full.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion config/TeX-MML-AM_HTMLorMML.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jax/input/AsciiMath/jax.js

Large diffs are not rendered by default.

16 changes: 15 additions & 1 deletion unpacked/jax/input/AsciiMath/jax.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@

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

var i; // avoid global variable used in code below

/******************************************************************
*
Expand All @@ -182,6 +183,11 @@
* A few items are commented out and marked with DPVC comments
* in order to keep the minifier from complaining about the
* coding practices in ASCIIMathML.js
*
* Two sections are modified to include changes from version 2.0.1 of
* ASCIIMathML.js and are marked with comments to that effect. This
* makes this version effectively the same as version 2.0.1, but
* without the overhead of the LaTeX-processing code.
*
******************************************************************/

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

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

Expand Down

0 comments on commit 3f41560

Please sign in to comment.