diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index f8b79e286..1ab70eac7 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -95,7 +95,7 @@ mathParser.functions.toWordsUpper = function (a) { mathParser.functions.toWordsLower = function (a) { return mathParser.functions.toWords(a).toLowerCase(); }; -mathParser.functions.toWordsCamel = function (a) { +mathParser.functions.toWordsCaps = function (a) { const words = mathParser.functions.toWords(a).split(' '); return words.map((word)=>{ return word.replace(/(?:^|\b|\s)(\w)/g, function(w, index) { diff --git a/tests/markdown/variables.test.js b/tests/markdown/variables.test.js index 8c58f4925..3773097ab 100644 --- a/tests/markdown/variables.test.js +++ b/tests/markdown/variables.test.js @@ -479,8 +479,8 @@ describe('Custom Math Function Tests', ()=>{ expect(rendered).toBe('
Words: eighty thousand and eighty-five
'); }); - it('Number to Words Test - Camelcase', function() { - const source = `[a]: 80085\n\nWords: $[toWordsCamel(a)]`; + it('Number to Words Test - Capitalized', function() { + const source = `[a]: 80085\n\nWords: $[toWordsCaps(a)]`; const rendered = Markdown.render(source).trimReturns(); expect(rendered).toBe('Words: Eighty Thousand And Eighty-Five
'); });