0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-28 07:02:38 +00:00

Fix and future-proof tests to use page 0 where necessary in markdown.render() calls.

This commit is contained in:
David Bolack
2024-06-11 20:06:20 -05:00
parent 1bece09339
commit cba57d1033
5 changed files with 114 additions and 114 deletions

View File

@@ -4,12 +4,12 @@ const Markdown = require('naturalcrit/markdown.js');
test('Processes the markdown within an HTML block if its just a class wrapper', function() {
const source = '<div>*Bold text*</div>';
const rendered = Markdown.render(source);
const rendered = Markdown.render(source, 0);
expect(rendered).toBe('<div> <p><em>Bold text</em></p>\n </div>');
});
test('Check markdown is using the custom renderer; specifically that it adds target=_self attribute to internal links in HTML blocks', function() {
const source = '<div>[Has _self Attribute?](#p1)</div>';
const rendered = Markdown.render(source);
const rendered = Markdown.render(source, 0);
expect(rendered).toBe('<div> <p><a href="#p1" target="_self">Has _self Attribute?</a></p>\n </div>');
});