From 9f17f36a87a4c9e9036f8258b02288516ec38a01 Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Mon, 3 Apr 2023 20:53:07 -0500 Subject: [PATCH] add trimReturns() method to strings to trim render output --- tests/markdown/mustache-syntax.test.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/markdown/mustache-syntax.test.js b/tests/markdown/mustache-syntax.test.js index 5d76044b8..0e378b711 100644 --- a/tests/markdown/mustache-syntax.test.js +++ b/tests/markdown/mustache-syntax.test.js @@ -3,6 +3,12 @@ const dedent = require('dedent-tabs').default; const Markdown = require('naturalcrit/markdown.js'); +// Marked.js adds line returns after closing tags on some default tokens. +// This removes those line returns for comparison sake. +String.prototype.trimReturns = function(){ + return this.replace(/\r?\n|\r/g, ''); +}; + test('Renders a mustache span with text only', function() { const source = '{{ text}}'; const rendered = Markdown.render(source);