diff --git a/src/environments.js b/src/environments.js index 6c43c759..9e89a961 100644 --- a/src/environments.js +++ b/src/environments.js @@ -96,6 +96,14 @@ function parseArray( if (next === "&") { parser.consume(); } else if (next === "\\end") { + // Arrays terminate newlines with `\crcr` which consumes a `\cr` if + // the last line is empty. + const lastRow = body[body.length - 1][0].value; + if (body.length > 1 + && lastRow.value.length === 1 + && lastRow.value[0].value.length === 0) { + body.pop(); + } break; } else if (next === "\\\\" || next === "\\cr") { const cr = parser.parseFunction(); diff --git a/test/screenshotter/images/AccentsText-chrome.png b/test/screenshotter/images/AccentsText-chrome.png index 0c9f8b8a..5a27d560 100644 Binary files a/test/screenshotter/images/AccentsText-chrome.png and b/test/screenshotter/images/AccentsText-chrome.png differ diff --git a/test/screenshotter/images/ArrayRemoveEmptyLine-chrome.png b/test/screenshotter/images/ArrayRemoveEmptyLine-chrome.png new file mode 100644 index 00000000..f0d84146 Binary files /dev/null and b/test/screenshotter/images/ArrayRemoveEmptyLine-chrome.png differ diff --git a/test/screenshotter/images/ArrayRemoveEmptyLine-firefox.png b/test/screenshotter/images/ArrayRemoveEmptyLine-firefox.png new file mode 100644 index 00000000..6a92f59e Binary files /dev/null and b/test/screenshotter/images/ArrayRemoveEmptyLine-firefox.png differ diff --git a/test/screenshotter/ss_data.yaml b/test/screenshotter/ss_data.yaml index e676c829..f7661ca9 100644 --- a/test/screenshotter/ss_data.yaml +++ b/test/screenshotter/ss_data.yaml @@ -38,6 +38,11 @@ ArrayMode: \end{matrix} display: 1 ArrayType: 1\begin{array}{c}2\\3\end{array}4 +ArrayRemoveEmptyLine: | + \begin{pmatrix} + 1 \\ + 2 \\ + \end{pmatrix} Baseline: a+b-c\cdot d/e BasicTest: a BinCancellation: |