mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-06 11:48:41 +00:00
fix: \char support for >16-bit Unicode characters (#3006)
* fix: \char support for >16-bit Unicode characters `String.fromCharCode` only supports Unicode characters up to 16-bit. `String.fromCodePoint` from ECMAScript 2015 supports all Unicode code points. Unfortunately, IE doesn't support the latter, so use former as fallback. Fixes #3004 Co-authored-by: ylemkimon <y@ylem.kim>
This commit is contained in:
@@ -3313,6 +3313,12 @@ describe("A macro expander", function() {
|
||||
expect(parsedChar[0].type).toEqual("textord");
|
||||
});
|
||||
|
||||
it("\\char handles >16-bit characters", () => {
|
||||
const parsed = getParsed('\\char"1d7d9');
|
||||
expect(parsed[0].type).toEqual("textord");
|
||||
expect(parsed[0].text).toEqual("𝟙");
|
||||
});
|
||||
|
||||
it("should build Unicode private area characters", function() {
|
||||
expect`\gvertneqq\lvertneqq\ngeqq\ngeqslant\nleqq`.toBuild();
|
||||
expect`\nleqslant\nshortmid\nshortparallel\varsubsetneq`.toBuild();
|
||||
|
Reference in New Issue
Block a user