test: cover multiline math with soft-break rewrite

This commit is contained in:
2026-10-27 11:56:52 +08:00
parent 968e89bf98
commit 53c39af0c8
3 changed files with 13 additions and 4 deletions

View File

@@ -73,7 +73,7 @@
- WebView2 Runtime
```powershell
cargo test # 51 个测试
cargo test # 52 个测试
.\agent\scripts\build.ps1 # release 构建 + 校验 + 复制到固定 exe 路径
```

View File

@@ -3,7 +3,7 @@
> 最后更新:2026-10-27 12:05
> 用途:上下文压缩/交接后快速恢复。详细背景见 AGENTS.md、HANDOFF.md、scan-2026-10-21.md、roadmap.md。
>
> **当前:功能 7(AI 输出方言兼容)已提交 `07ac997`,51 个测试通过;旧实例仍在运行,exe 尚未重建/部署。** 下次开工先读第 14 节交接。
> **当前:功能 7(AI 输出方言兼容)已提交 `07ac997`,52 个测试通过;旧实例仍在运行,exe 尚未重建/部署。** 下次开工先读第 14 节交接。
## 1. 仓库
@@ -27,7 +27,7 @@
## 2. 当前构建/部署状态
- `cargo test`:51 passed / 0 failed(2026-10-27,功能 7)。
- `cargo test`:52 passed / 0 failed(2026-10-27,功能 7)。
- 已部署(2026-10-21 17:25 左右,仍是旧版):
- 大小 5,501,440 字节
- SHA256 `F76BC3963BA13BBFC8259BC2B4E3D24468C34E3C9E26491D364D5D364BEDE96C`(快照,不保证可复现)
@@ -44,7 +44,7 @@
| 4 | 标题 hover 折叠 | 完成并部署 `f74a04b` |
| 5 | 布局微调 + 只读文件保存失败修复 | 完成并部署 `097d2ee` |
| 6 | 折叠三角固定 90% + 折角箭头 | 完成并部署 `b01553e` |
| 7 | AI 输出方言兼容:softbreak→`<br>`、GFM 脚注、定义列表、UTF-8 BOM | 已提交 `07ac997`,51 tests;待构建/部署 |
| 7 | AI 输出方言兼容:softbreak→`<br>`、GFM 脚注、定义列表、UTF-8 BOM | 已提交 `07ac997`,52 tests;待构建/部署 |
## 4. 已确认的产品决策

View File

@@ -2174,6 +2174,15 @@ mod tests {
assert!(!html.contains("<em>"));
}
#[test]
fn multiline_display_math_is_not_split_by_hard_breaks() {
let html = md_to_html("$$\na + b\n$$");
assert!(html.contains(r#"class="math math-display""#), "{html}");
assert!(html.contains("a + b"), "{html}");
assert!(!html.contains("<br />"), "{html}");
}
#[test]
fn github_alerts_render_as_markdown_alert_blockquotes() {
let html = md_to_html("> [!IMPORTANT]\n> This is an alert");