refactor(Markdown): update disallowed elements to include 'script' for enhanced security

This commit is contained in:
kangfenmao 2025-08-19 18:11:20 +08:00
parent c5554995dd
commit 0368583cfc

View File

@ -36,7 +36,7 @@ import Table from './Table'
const ALLOWED_ELEMENTS =
/<(style|p|div|span|b|i|strong|em|ul|ol|li|table|tr|td|th|thead|tbody|h[1-6]|blockquote|pre|code|br|hr|svg|path|circle|rect|line|polyline|polygon|text|g|defs|title|desc|tspan|sub|sup)/i
const DISALLOWED_ELEMENTS = ['iframe']
const DISALLOWED_ELEMENTS = ['iframe', 'script']
interface Props {
// message: Message & { content: string }