feat(document-preview): enhance security by sanitizing HTML and Markdown content

- Integrated sanitizeHTML and safeMarkdownToHTML functions to ensure that rendered HTML and Markdown content is safe from XSS vulnerabilities.
- Updated the rendering logic for Excel and Markdown to sanitize the output, improving overall security in document previews.
This commit is contained in:
wizardchen
2026-04-16 15:15:20 +08:00
parent a1a07e6818
commit fb714ea883
2 changed files with 5 additions and 6 deletions
@@ -189,10 +189,6 @@ const renderToken = (token) => {
}
};
const myMarkdown = (res) => {
return marked.parse(res, { renderer })
}
// 获取实际内容
const getActualContent = () => {
return (props.content || props.session?.content || '').trim();