Преглед изворни кода

fix(html-parser): sanitize unclosed tags in markdown rendering (#14309)

tags/1.0.0
Chuckie Li пре 8 месеци
родитељ
комит
d5711589cd
No account linked to committer's email address
1 измењених фајлова са 5 додато и 0 уклоњено
  1. 5
    0
      web/app/components/base/markdown.tsx

+ 5
- 0
web/app/components/base/markdown.tsx Прегледај датотеку

@@ -258,6 +258,11 @@ export function Markdown(props: { content: string; className?: string }) {
if (node.type === 'element' && node.properties?.ref)
delete node.properties.ref

if (node.type === 'element' && !/^[a-z][a-z0-9]*$/i.test(node.tagName)) {
node.type = 'text'
node.value = `<${node.tagName}`
}

if (node.children)
node.children.forEach(iterate)
}

Loading…
Откажи
Сачувај