Radish alpha
r
rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5
Radicle web interface
Radicle
Git
Fix inline emphasis tags in markdown output
Merged 2color opened 8 days ago
  • Without strong, bold rendered as plain text since marked emits <strong> and DOMPurify stripped the unknown tag
  • Add strong, b, i, del, s to DOMPurify allow-list
  • Cover the other inline emphasis tags authors may write as raw HTML or that GFM strikethrough emits (<del>)
1 file changed +5 -0 c45c9198 b6743c63
modified src/lib/markdown.ts
@@ -31,14 +31,17 @@ dompurify.setConfig({
  ],
  ALLOWED_TAGS: [
    "a",
+
    "b",
    "blockquote",
    "br",
    "code",
    "dd",
+
    "del",
    "div",
    "dl",
    "dt",
    "em",
+
    "i",
    "h1",
    "h2",
    "h3",
@@ -53,6 +56,8 @@ dompurify.setConfig({
    "p",
    "pre",
    "radicle-external-link",
+
    "s",
+
    "strong",
    "table",
    "tbody",
    "td",