www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 3203959b96bfdbd948ef46c4803d1b0014696593
parent 961e1caba917372696042352ca48737f11a7cbbd
Author: Kevin Barabash <kevinb7@gmail.com>
Date:   Fri, 25 Sep 2015 14:20:23 -0700

Merge pull request #352 from Khan/fix_font_greediness

Set the greedines of font functions to 2 so that e^\mathbf{x} will parse
Diffstat:
Msrc/functions.js | 3++-
Mtest/katex-spec.js | 4++++
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/functions.js b/src/functions.js @@ -462,7 +462,8 @@ defineFunction([ // aliases "\\Bbb", "\\bold", "\\frak" ], { - numArgs: 1 + numArgs: 1, + greediness: 2 }, function (func, body) { if (func in fontAliases) { func = fontAliases[func]; diff --git a/test/katex-spec.js b/test/katex-spec.js @@ -1259,6 +1259,10 @@ describe("A font parser", function () { expect(bf.value.body.value[1].value.font).toMatch("mathrm"); expect(bf.value.body.value[2].value).toMatch("c"); }); + + it("should have the correct greediness", function() { + expect("e^\\mathbf{x}").toParse(); + }); }); describe("An HTML font tree-builder", function () {