diff --git a/TeXZilla.jison b/TeXZilla.jison index ae6a21a..f479bec 100644 --- a/TeXZilla.jison +++ b/TeXZilla.jison @@ -71,6 +71,10 @@ function newMo(aContent, aLeftSpace, aRightSpace) { return tag; } +function newSpace(aWidth) { + return ""; +} + function newScript(aUnderOver, aBase, aScriptBot, aScriptTop) { /* Create a new MathML script element. */ if (aUnderOver) { @@ -697,14 +701,14 @@ closedTerm | SLASH closedTerm { $$ = newTag("menclose", $2, "notation=\"updiagonalstrike\""); } - | QUAD { $$ = ""; } - | QQUAD { $$ = ""; } - | NEGSPACE { $$ = ""; } - | NEGMEDSPACE { $$ = ""; } - | NEGTHICKSPACE { $$ = ""; } - | THINSPACE { $$ = ""; } - | MEDSPACE { $$ = ""; } - | THICKSPACE { $$ = ""; } + | QUAD { $$ = newSpace(1); } + | QQUAD { $$ = newSpace(2); } + | NEGSPACE { $$ = newSpace(namedSpaceToEm("negativethinmathspace")); } + | NEGMEDSPACE { $$ = newSpace(namedSpaceToEm("negativemediummathspace")); } + | NEGTHICKSPACE { $$ = newSpace(namedSpaceToEm("negativethickmathspace")); } + | THINSPACE { $$ = newSpace(namedSpaceToEm("thinmathspace")); } + | MEDSPACE { $$ = newSpace(namedSpaceToEm("mediummathspace")); } + | THICKSPACE { $$ = newSpace(namedSpaceToEm("thickmathspace")); } | SPACE textArg textArg textArg { $$ = ""; diff --git a/unit-tests.js b/unit-tests.js index 442eb7c..de26db8 100644 --- a/unit-tests.js +++ b/unit-tests.js @@ -147,7 +147,7 @@ var tests = [ /* \quad, \qquad */ ["\\quad \\qquad", '\\quad \\qquad'], /* spaces */ - ["\\! \\, \\: \\; \\medspace \\negspace \\negmedspace \\negthickspace \\thickspace \\thinspace", '\\! \\, \\: \\; \\medspace \\negspace \\negmedspace \\negthickspace \\thickspace \\thinspace'], + ["\\! \\, \\: \\; \\medspace \\negspace \\negmedspace \\negthickspace \\thickspace \\thinspace", '\\! \\, \\: \\; \\medspace \\negspace \\negmedspace \\negthickspace \\thickspace \\thinspace'], /* space */ ["\\space{1}{2}{3}", '\\space{1}{2}{3}'], /* mathraisebox */