diff --git a/package.json b/package.json index aa0a926c..72b4d2fa 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "clean": "rm -rf build/* node_modules/", "clean-install": "npm run clean && npm i", "test": "check-dependencies && npm run lint && npm run flow && npm run jest", + "verify-screenshots": "check-dependencies && dockers/Screenshotter/screenshotter.sh --verify", "start": "check-dependencies && webpack-dev-server --open --config webpack.dev.js", "build": "check-dependencies && rimraf build/* && webpack", "watch": "npm run build -- --watch", diff --git a/src/buildHTML.js b/src/buildHTML.js index 17845996..9779436f 100644 --- a/src/buildHTML.js +++ b/src/buildHTML.js @@ -19,10 +19,6 @@ import {spacings, tightSpacings} from "./spacingData"; const makeSpan = buildCommon.makeSpan; -const isSpace = function(node) { - return node instanceof domTree.span && node.classes[0] === "mspace"; -}; - // Binary atoms (first class `mbin`) change into ordinary atoms (`mord`) // depending on their surroundings. See TeXbook pg. 442-446, Rules 5 and 6, // and the text before Rule 19. @@ -50,23 +46,6 @@ const isBinRightCanceller = function(node, isRealGroup) { } }; -/** - * Splice out any spaces from `children` starting at position `i`, and return - * the spliced-out array. Returns null if `children[i]` does not exist or is not - * a space. - */ -export const spliceSpaces = function(children, i) { - let j = i; - while (j < children.length && isSpace(children[j])) { - j++; - } - if (j === i) { - return null; - } else { - return children.splice(i, j - i); - } -}; - const styleMap = { "display": Style.DISPLAY, "text": Style.TEXT, @@ -149,10 +128,7 @@ export const buildExpression = function(expression, options, isRealGroup) { } } - const glue = buildCommon.makeGlue( - spacings[left][right], glueOptions); - - groups.push(glue); + groups.push(buildCommon.makeGlue(space, glueOptions)); } } j++; diff --git a/test/screenshotter/images/Spacing-chrome.png b/test/screenshotter/images/Spacing-chrome.png index 436545b6..5a8cf67e 100644 Binary files a/test/screenshotter/images/Spacing-chrome.png and b/test/screenshotter/images/Spacing-chrome.png differ diff --git a/test/screenshotter/images/Spacing-firefox.png b/test/screenshotter/images/Spacing-firefox.png index e5b40cdc..4e3d75b4 100644 Binary files a/test/screenshotter/images/Spacing-firefox.png and b/test/screenshotter/images/Spacing-firefox.png differ diff --git a/test/screenshotter/ss_data.yaml b/test/screenshotter/ss_data.yaml index 8a92f12e..2b4b5a1a 100644 --- a/test/screenshotter/ss_data.yaml +++ b/test/screenshotter/ss_data.yaml @@ -241,7 +241,12 @@ SizingBaseline: Sizing: | {\Huge x}{\LARGE y}{\normalsize z}{\scriptsize w}\sqrt[\small 3]{x+1} Smash: \left( X^{\smash 2} \right) \sqrt{\smash[b]{y}} -Spacing: ^3+[-1][1-1]1=1(=1)\lvert a\rvert~b +Spacing: | + \begin{matrix} + ^3+[-1][1-1]1=1(=1)\lvert a\rvert~b \\ + \scriptstyle{^3+[-1][1-1]1=1(=1)\lvert a\rvert~b} \\ + \scriptscriptstyle{^3+[-1][1-1]1=1(=1)\lvert a\rvert~b} \\ + \end{matrix} Sqrt: | \sqrt{\sqrt{\sqrt{x}}}_{\sqrt{\sqrt{x}}}^{\sqrt{\sqrt{\sqrt{x}}} ^{\sqrt{\sqrt{\sqrt{x}}}}}