Improvements to #530 styling

This commit is contained in:
Zef Hemel
2023-10-29 12:10:30 +01:00
parent 63b614670c
commit 7e9a3f7b6a
5 changed files with 80 additions and 26 deletions
+26 -6
View File
@@ -29,17 +29,37 @@ Deno.test("Markdown render", async () => {
await system.unloadAll();
});
Deno.test("Smart hard break test", async () => {
Deno.test("Smart hard break test", () => {
const example = `**Hello**
*world!*`;
const lang = buildMarkdown([]);
const tree = parse(lang, example);
const html = renderMarkdownToHtml(tree, {
const html = renderMarkdownToHtml(tree, {
failOnUnknown: true,
smartHardBreak: true,
});
assertEquals(
html,
`<p><strong>Hello</strong><br/><em>world!</em></p>`,
);
// assertEquals(
// html,
// `<span class="p"><strong>Hello</strong><br><em>world!</em></span>`,
// );
const example2 = `This is going to be a text. With a new line.
And another
* and a list
* with a second item
### [[Bla]]
Url: something
Server: something else
📅 last_updated - [Release notes](release_notes_url)`;
const tree2 = parse(lang, example2);
const html2 = renderMarkdownToHtml(tree2, {
failOnUnknown: true,
smartHardBreak: true,
});
console.log(html2);
});