From f50424e50b9737f0c1059176f329429f7243a2b7 Mon Sep 17 00:00:00 2001
From: Yao Jingxi <23722032@bjtu.edu.cn>
Date: Sat, 14 Nov 2026 12:28:57 +0800
Subject: [PATCH] =?UTF-8?q?feat(markdown):=20=E5=86=85=E5=B5=8C=20SVG=20?=
=?UTF-8?q?=E6=8C=89=E7=99=BD=E5=90=8D=E5=8D=95=E4=BF=9D=E7=95=99=E7=BB=98?=
=?UTF-8?q?=E5=9B=BE=E5=85=83=E7=B4=A0=EF=BC=8C=E8=84=9A=E6=9C=AC=E3=80=81?=
=?UTF-8?q?=E5=A4=96=E9=83=A8=E5=BC=95=E7=94=A8=E5=92=8C=20style=20?=
=?UTF-8?q?=E4=BB=8D=E8=A2=AB=E5=89=A5=E7=A6=BB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
markdown.render 的 Ammonia 过滤器放行 SVG 的图形、文字、use、image、渐变、图案、裁剪、蒙版、标记和不加载外部资源的滤镜,以及它们的几何与展示属性;script、foreignObject、style 元素、动画元素、feImage 和 style 属性仍被剥离,use/textPath 只能引用本文档的 #id。共享 fixture markdown-render-v1.json 增加内嵌 SVG 用例,Core 新增测试跑完整份 fixture。
---
rust/contracts/rust-core-api.md | 7 +-
rust/crates/project/src/markdown.rs | 225 +++++++++++++++++++
rust/fixtures/editor/markdown-render-v1.json | 28 +++
3 files changed, 259 insertions(+), 1 deletion(-)
diff --git a/rust/contracts/rust-core-api.md b/rust/contracts/rust-core-api.md
index b70ae6d4..a4a0b190 100644
--- a/rust/contracts/rust-core-api.md
+++ b/rust/contracts/rust-core-api.md
@@ -5452,7 +5452,12 @@ these attributes and the original decoded code text.
Raw formatting HTML can survive, but scripts, executable attributes, embeds,
arbitrary inline styles and unsafe URL schemes are removed in Core before
-embedding. Windows asynchronously requests this existing command via its
+embedding. Inline `
\n",
+ "contains": [
+ "Lithe",
+ "Logo",
+ "