fix(outboundtext): keep resource handles intact when normalizing formulas

This commit is contained in:
姚章浩
2026-09-18 17:14:45 +08:00
parent 48b741984f
commit 1bbaf2f07a
6 changed files with 84 additions and 21 deletions
+2
View File
@@ -12,6 +12,8 @@ func TestNormalizeMath(t *testing.T) {
{"nth root", `$\sqrt[3]{V}$`, `√[3](V)`},
{"no math untouched", `C:\new\folder 与 100% 覆盖`, `C:\new\folder 与 100% 覆盖`},
{"dollar free prose", `价格是 5 元, 无公式`, `价格是 5 元, 无公式`},
{"resource url untouched", `![图](resource://efVTXx0gY9Lk2vuZM_pltQ) 公式 $r = \sqrt{X^2 + Y^2}$`, `![图](resource://efVTXx0gY9Lk2vuZM_pltQ) 公式 r = √(X² + Y²)`},
{"code span untouched", "`x_1` 与 $x_1$", "`x_1` 与 x₁"},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {