Allow emphasis in post content

This commit is contained in:
silverpill 2022-10-06 21:29:05 +00:00
parent a71192e535
commit fa10cd95c0
2 changed files with 2 additions and 2 deletions

View file

@ -10,7 +10,7 @@ const markdown = new MarkdownIt({ linkify: true, breaks: true })
// Minimal renderer // Minimal renderer
const markdownLite = new MarkdownIt({ linkify: true, breaks: true }) const markdownLite = new MarkdownIt({ linkify: true, breaks: true })
.disable(["emphasis", "strikethrough", "image"]) .disable(["strikethrough", "image"])
.use( .use(
MarkdownItLinkAttrs, MarkdownItLinkAttrs,
{ attrs: { target: "_blank", rel: "noopener" } }, { attrs: { target: "_blank", rel: "noopener" } },

View file

@ -5,6 +5,6 @@ describe("Render markdown", () => {
it("Render markdown lite", () => { it("Render markdown lite", () => {
const text = "test **bold** ~~strike~~ with `code`, <span>html</span> and https://example.com\nand a new line" const text = "test **bold** ~~strike~~ with `code`, <span>html</span> and https://example.com\nand a new line"
const html = renderMarkdownLite(text) const html = renderMarkdownLite(text)
expect(html).to.equal('test **bold** ~~strike~~ with <code>code</code>, &lt;span&gt;html&lt;/span&gt; and <a href="https://example.com" target="_blank" rel="noopener">https://example.com</a><br>\nand a new line') expect(html).to.equal('test <strong>bold</strong> ~~strike~~ with <code>code</code>, &lt;span&gt;html&lt;/span&gt; and <a href="https://example.com" target="_blank" rel="noopener">https://example.com</a><br>\nand a new line')
}) })
}) })