diff --git a/tests/markdown/mustache-syntax.test.js b/tests/markdown/mustache-syntax.test.js index d9e1ce6f9..5861b4c7b 100644 --- a/tests/markdown/mustache-syntax.test.js +++ b/tests/markdown/mustache-syntax.test.js @@ -112,18 +112,29 @@ describe('Inline: When using the Inline syntax {{ }}', ()=>{ }); - it.failing('Renders a mustache span with text with quotes and css property which contains quotes', function() { + it.failing('Renders a mustache span with text with quotes and css property which contains double quotes', function() { const source = '{{font-family:"trebuchet ms" text "with quotes"}}'; const rendered = Markdown.render(source); // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text “with quotes”'); }); + + it.failing('Renders a mustache span with text with quotes and css property which contains double and simple quotes', function() { + const source = `{{--stringVariable:"'string'" text "with quotes"}}`; + const rendered = Markdown.render(source); + // FIXME: adds extra \s after class names + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`text “with quotes”`); + }); + + it('Renders a mustache span with text, id, class and a couple of css properties', function() { const source = '{{pen,#author,color:orange,font-family:"trebuchet ms" text}}'; const rendered = Markdown.render(source); expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); + + }); // BLOCK SYNTAX @@ -191,6 +202,15 @@ describe(`Block: When using the Block syntax {{tags\\ntext\\n}}`, ()=>{ expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

Sample text.

`); }); + it.failing('Renders a div with a style that has a string variable, and text', function() { + const source = dedent`{{--stringVariable:"'string'" + Sample text. + }}`; + const rendered = Markdown.render(source).trimReturns(); + // FIXME: adds two extra \s before closing `>` in opening tag + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

Sample text.

`); + }); + it.failing('Renders a div with a class, style and text', function() { const source = dedent`{{cat,color:red Sample text. @@ -241,6 +261,12 @@ describe('Injection: When an injection tag follows an element', ()=>{ expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); + it.failing('Renders a span "text" with injected style using a string variable', function() { + const source = `{{ text}}{--stringVariable:"'string'"}`; + const rendered = Markdown.render(source); + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`text`); + }); + it.failing('Renders a span "text" with two injected styles', function() { const source = '{{ text}}{color:red,background:blue}'; const rendered = Markdown.render(source); @@ -291,13 +317,13 @@ describe('Injection: When an injection tag follows an element', ()=>{ expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('

text

'); }); - it.failing('renders a div "text" with two injected styles', function() { + it.failing('renders a div "text" with two injected styles,included quotes', function() { const source = dedent`{{ text }} - {color:red,background:blue}`; + {color:red,--stringVariable:"'string'"}`; const rendered = Markdown.render(source).trimReturns(); - expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('

text

'); + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

text

`); }); it.failing('renders an h2 header "text" with injected class name', function() {