-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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!
- Loading branch information
1 parent
991bfd5
commit 3e34453
Showing
2 changed files
with
12 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1251,6 +1251,11 @@ describe("A begin/end parser", function() { | |
it("should allow \\cr as a line terminator", function() { | ||
expect("\\begin{matrix}a&b\\cr c&d\\end{matrix}").toParse(); | ||
}); | ||
|
||
it("should eat a final newline", function() { | ||
const m3 = getParsed("\\begin{matrix}a&b\\\\ c&d \\\\ \\end{matrix}")[0]; | ||
expect(m3.value.body.length).toBe(2); | ||
}); | ||
}); | ||
|
||
describe("A sqrt parser", function() { | ||
|
@@ -2409,6 +2414,10 @@ describe("An aligned environment", function() { | |
.toNotParse(); | ||
}); | ||
|
||
it("should not eat the last row when its first cell is empty", function() { | ||
const ae = getParsed("\\begin{aligned}&E_1 & (1)\\\\&E_2 & (2)\\\\E_3 & (3)\\end{aligned}")[0]; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
kevinbarabash
Member
|
||
expect(ae.value.body.length).toBe(3); | ||
}); | ||
}); | ||
|
||
describe("A parser that does not throw on unsupported commands", function() { | ||
|
Shouldn't there be an
&
before theE_3
?