From 7353e6c7ac54b4228f8cc0863ed7c6f201f86031 Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Mon, 3 Apr 2023 16:57:29 -0500 Subject: [PATCH] Add unit tests for double injection into block and inline --- tests/markdown/mustache-span.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/markdown/mustache-span.test.js b/tests/markdown/mustache-span.test.js index 6d249ebcb..e7c65ea77 100644 --- a/tests/markdown/mustache-span.test.js +++ b/tests/markdown/mustache-span.test.js @@ -105,6 +105,22 @@ test('Renders a mustache span with text, id, class and a couple of css propertie expect(rendered).toBe('text'); }); +test('Two consecutive injections into Inline', function() { + const source = '{{dog Sample Text}}{cat}{toad}'; + const rendered = Markdown.render(source); + // FIXME: Drops original attributes in favor of injection, rather than adding. + // FIXME: Doesn't keep the raw text of second injection. + // FIXME: Renders the extra class attribute (which is dropped by the browser). + expect(rendered).toBe('
Sample Text
\n'); +}); + +test('Two consecutive injections into Block', function() { + const source = '{{dog\nSample Text\n}}\n{cat}\n{toad}'; + const rendered = Markdown.render(source); + // FIXME: Renders the extra class attribute (which is dropped by the browser). + expect(rendered).toBe('Sample Text
\n{toad}
\n'); +}); + // TODO: add tests for ID with accordance to CSS spec: // // From https://drafts.csswg.org/selectors/#id-selectors: