diff --git a/src/lib/rehype-content-sanitize.ts b/src/lib/rehype-content-sanitize.ts new file mode 100644 index 0000000..00edec4 --- /dev/null +++ b/src/lib/rehype-content-sanitize.ts @@ -0,0 +1,93 @@ +/** + * rehype 内容净化(标签/属性/协议级)——页面文案管线的第二道防线。 + * + * 为什么需要:`renderMarkdown()` 走的是 `@astrojs/markdown-remark` 的独立处理器, + * 默认 `allowDangerousHtml: true` 且无条件挂 `rehype-raw`;若不筛标签,后台 + * (或远程 README)写入的 `