mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-06 19:58:40 +00:00
Fix \nobreakspace, refactor "regular space" checking (#1200)
* Fix \nobreakspace, refactor "regular space" checking Fix #1199 by adding \nobreakspace to the list of commands/symbols that behave like a regular space character. Refactor to put that list in one place, and use an object so it checks instantly instead of sequentially. * Copy test from #1201
This commit is contained in:
committed by
Kevin Barabash
parent
017eb7b91d
commit
abfb641d7a
@@ -875,6 +875,11 @@ describe("A text parser", function() {
|
||||
expect(textWithEmbeddedMath).toParse();
|
||||
});
|
||||
|
||||
it("should parse spacing functions", function() {
|
||||
expect("a b\\, \\; \\! \\: ~ \\thinspace \\medspace \\quad \\ ").toBuild();
|
||||
expect("\\enspace \\thickspace \\qquad \\space \\nobreakspace").toBuild();
|
||||
});
|
||||
|
||||
it("should omit spaces after commands", function() {
|
||||
expect("\\text{\\textellipsis !}")
|
||||
.toParseLike("\\text{\\textellipsis!}");
|
||||
@@ -2999,11 +3004,11 @@ describe("The \\mathchoice function", function() {
|
||||
|
||||
describe("Symbols", function() {
|
||||
it("should parse \\text{\\i\\j}", () => {
|
||||
expect("\\text{\\i\\j}").toParse();
|
||||
expect("\\text{\\i\\j}").toBuild();
|
||||
});
|
||||
|
||||
it("should parse spacing functions in math or text mode", () => {
|
||||
expect("A\\;B\\,C\\nobreakspace \\text{A\\;B\\,C\\nobreakspace}").toParse();
|
||||
expect("A\\;B\\,C\\nobreakspace \\text{A\\;B\\,C\\nobreakspace}").toBuild();
|
||||
});
|
||||
|
||||
it("should render ligature commands like their unicode characters", () => {
|
||||
|
Reference in New Issue
Block a user