0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-01 02:02:43 +00:00

Small fix and test updates

Discovered that classes ( and possibly other splits could end up with an
empty/null member that still gets joined so I added a trim to the end of
all the joins in processStyleTags.

Added tests that SHOULD test for bloc-level and inline-span moustaches
with added attributes ( a=b )
This commit is contained in:
David Bolack
2023-12-06 17:48:51 -06:00
parent 688eca05e1
commit 769f636db2
2 changed files with 16 additions and 3 deletions

View File

@@ -130,6 +130,18 @@ describe('Inline: When using the Inline syntax {{ }}', ()=>{
const rendered = Markdown.render(source).trimReturns();
expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`<p><img class=" " style="position:absolute; bottom:20px; left:130px; width:220px;" a="b and c" d="e" src="https://i.imgur.com/hMna6G0.png" alt="homebrew mug"></p>`);
});
it('Render a span with added attributes', function() {
const source = 'Text and {{pen,#author,color:orange,font-family:"trebuchet ms",a="b and c",d=e, text}} and more text!';
const rendered = Markdown.render(source);
expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('<p>Text and <span class="inline-block pen" id="author" style="color:orange; font-family:trebuchet ms;" a="b and c" d="e">text</span> and more text!</p>\n');
});
it('Render a div with added attributes', function() {
const source = '{{pen,#author,color:orange,font-family:"trebuchet ms",a="b and c",d=e\nText and text and more text!\n}}\n';
const rendered = Markdown.render(source);
expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('<div class="block pen" id="author" style="color:orange; font-family:trebuchet ms;" a="b and c" d="e"><p>Text and text and more text!</p>\n</div>');
});
});
// BLOCK SYNTAX