mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-12 14:38:39 +00:00
* Fix #946 Issue #946 identified a case in which `array.js` ate the final row of a well-written `aligned` environment. This PR modifies code from PR #479 to fix this problem and to also continue to eat a trailing `\\` submitted to any environment. * Fix bug and add tests * Add final newline to test. Doh!
This commit is contained in:
@@ -62,10 +62,10 @@ function parseArray(
|
||||
} 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;
|
||||
const lastRow = body[body.length - 1];
|
||||
if (body.length > 1
|
||||
&& lastRow.value.length === 1
|
||||
&& lastRow.value[0].value.length === 0) {
|
||||
&& lastRow.length === 1
|
||||
&& lastRow[0].value.value[0].value.length === 0) {
|
||||
body.pop();
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user