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:
Emily Eisenberg
2015-08-18 14:32:57 -07:00
parent cb9f765e06
commit 3a8adbf595
7 changed files with 111 additions and 27 deletions

View File

@@ -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: "|" }
]);
});
});