fix(security): harden URL and HTML sanitization

This commit is contained in:
RhenCloud committed 2026-10-24 16:41:29 +08:00
1 parent 978c53eeb3
commit c07741bf54
6 files changed
+9 -6

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@ import { renderNeutralMessage } from "./render";
const markdown = new MarkdownIt({ html: false, linkify: false, breaks: false, typographer: false });
function markdownToText(value: string): string {
return markdown.renderInline(value).replace(/<[^>]*>/gu, "");
return markdown.renderInline(value).replace(/<[^>]*>/gu, "").replace(/</g, "");
}
function smallAvatar(url: string): string {