feat: Support \vcenter and \hbox (#2452)

* Support \vcenter, \raise, \lower, and \hbox

* Update screenshots

* Edit docs for strict and hbox to

* Fix typo for \hbox to

* Update Safari screenshot

* Augment docs for \vcentcolon

* Edit vcenter MathML comment.

* Remove pointless class from vcenter MathML

* Withdraw \raise and \lower

* Updatae Chrome and Firefox screenshots

* Update Safari screenshot

* Delete allowedInArgument setting

Co-authored-by: ylemkimon <y@ylem.kim>

* Update Chrome and Firefox screenshots

* Update Chrome and Firefox screenshots take 2

* Update screenshot

Co-authored-by: ylemkimon <y@ylem.kim>
This commit is contained in:
Ron Kok
2020-11-14 01:45:14 -08:00
committed by GitHub
parent ebd86b90c4
commit 60aecbdfe2
16 changed files with 169 additions and 10 deletions

View File

@@ -1642,6 +1642,36 @@ describe("A \\pmb builder", function() {
});
});
describe("A raise parser", function() {
it("should parse and build text in \\raisebox", function() {
expect("\\raisebox{5pt}{text}").toBuild(strictSettings);
expect("\\raisebox{-5pt}{text}").toBuild(strictSettings);
});
it("should parse and build math in non-strict \\vcenter", function() {
expect("\\vcenter{\\frac a b}").toBuild(nonstrictSettings);
});
it("should fail to parse math in \\raisebox", function() {
expect("\\raisebox{5pt}{\\frac a b}").not.toParse(nonstrictSettings);
expect("\\raisebox{-5pt}{\\frac a b}").not.toParse(nonstrictSettings);
});
it("should fail to parse math in an \\hbox", function() {
expect("\\hbox{\\frac a b}").not.toParse(nonstrictSettings);
});
it("should fail to build, given an unbraced length", function() {
expect("\\raisebox5pt{text}").not.toBuild(strictSettings);
expect("\\raisebox-5pt{text}").not.toBuild(strictSettings);
});
it("should build math in an hbox when math mode is set", function() {
expect("a + \\vcenter{\\hbox{$\\frac{\\frac a b}c$}}").toBuild(strictSettings);
});
});
describe("A comment parser", function() {
it("should parse comments at the end of a line", () => {
expect("a^2 + b^2 = c^2 % Pythagoras' Theorem\n").toParse();