mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-09 21:18:40 +00:00
feat(function): add allowedInArgument
instead of greediness
property (#2134)
* Remove `greediness` property Use boolean `grouped` property instead, which is more consistent with LaTeX. BREAKING CHANGE: \cfrac, \color, \textcolor, \colorbox, \fcolorbox are no longer grouped. * Rename grouped to allowedInArgument * Reenable tests * Update documentation * Fix typo Co-authored-by: Kevin Barabash <kevinb@khanacademy.org>
This commit is contained in:
@@ -849,13 +849,6 @@ describe("A color parser", function() {
|
||||
expect(newColorExpression).toParse();
|
||||
});
|
||||
|
||||
it("should have correct greediness", function() {
|
||||
expect`\textcolor{red}a`.toParse();
|
||||
expect`\textcolor{red}{\text{a}}`.toParse();
|
||||
expect`\textcolor{red}\text{a}`.not.toParse();
|
||||
expect`\textcolor{red}\frac12`.not.toParse();
|
||||
});
|
||||
|
||||
it("should use one-argument \\color by default", function() {
|
||||
expect(oldColorExpression).toParseLike`\textcolor{#fA6}{xy}`;
|
||||
});
|
||||
@@ -1619,7 +1612,7 @@ describe("A font parser", function() {
|
||||
expect(bf.body.body[2].text).toEqual("c");
|
||||
});
|
||||
|
||||
it("should have the correct greediness", function() {
|
||||
it("should be allowed in the argument", function() {
|
||||
expect`e^\mathbf{x}`.toParse();
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user