mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-08 12:38:39 +00:00
leqno and fleqn support (#1814)
* leqno support * Add fleqn support * Add tests * Lint fix * Add leqno and fleqn to website demo
This commit is contained in:
@@ -3174,6 +3174,29 @@ describe("\\tag support", function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe("leqno and fleqn rendering options", () => {
|
||||
const expr = r`\tag{hi}x+y`;
|
||||
for (const opt of ["leqno", "fleqn"]) {
|
||||
it(`should not add ${opt} class by default`, () => {
|
||||
const settings = new Settings({displayMode: true});
|
||||
const built = katex.__renderToDomTree(expr, settings);
|
||||
expect(built.classes).not.toContain(opt);
|
||||
});
|
||||
it(`should not add ${opt} class when false`, () => {
|
||||
const settings = new Settings({displayMode: true});
|
||||
settings[opt] = false;
|
||||
const built = katex.__renderToDomTree(expr, settings);
|
||||
expect(built.classes).not.toContain(opt);
|
||||
});
|
||||
it(`should add ${opt} class when true`, () => {
|
||||
const settings = new Settings({displayMode: true});
|
||||
settings[opt] = true;
|
||||
const built = katex.__renderToDomTree(expr, settings);
|
||||
expect(built.classes).toContain(opt);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
describe("\\@binrel automatic bin/rel/ord", () => {
|
||||
it("should generate proper class", () => {
|
||||
expect("L\\@binrel+xR").toParseLike("L\\mathbin xR");
|
||||
|
Reference in New Issue
Block a user