mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 11:18:39 +00:00
Add | column separators to arrays.
This adds the ability to add `|` to a column description and have vertical separators be added. I added types to the column descriptions and added some logic to handle the separators when building the vertical lists of the array. Test plan: - See the Arrays screenshot looks good. - `make test`
This commit is contained in:
@@ -1354,7 +1354,22 @@ describe("An array environment", function() {
|
||||
it("should accept a single alignment character", function() {
|
||||
var parse = getParsed("\\begin{array}r1\\\\20\\end{array}");
|
||||
expect(parse[0].type).toBe("array");
|
||||
expect(parse[0].value.cols).toEqual([{align:"r"}]);
|
||||
expect(parse[0].value.cols).toEqual([
|
||||
{ type: "align", align: "r" }
|
||||
]);
|
||||
});
|
||||
|
||||
it("should accept vertical separators", function() {
|
||||
var parse = getParsed("\\begin{array}{|l||c|}\\end{array}");
|
||||
expect(parse[0].type).toBe("array");
|
||||
expect(parse[0].value.cols).toEqual([
|
||||
{ type: "separator", separator: "|" },
|
||||
{ type: "align", align: "l" },
|
||||
{ type: "separator", separator: "|" },
|
||||
{ type: "separator", separator: "|" },
|
||||
{ type: "align", align: "c" },
|
||||
{ type: "separator", separator: "|" }
|
||||
]);
|
||||
});
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user