Files
MyNote/tests/fixtures/roundtrip/README.md
T

35 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 往返 fixture 集(Round-trip Corpus)
> 用途:狩夜人笔记编辑器 Markdown 往返回归基线。每个 .md 是一条输入语料;断言策略见《去风险验证任务书》A.5。
> 判据:mdast 等价(输入 md 与往返结果 md 各自 parse 成 mdast 后 deep-equal),非字节相等。
## 文件清单与期望
| 文件 | 类别 | 期望 |
|---|---|---|
| emphasis-nested.md | 嵌套强调 | mdast-equal |
| escaping.md | 反斜杠转义 | mdast-equal |
| html.md | 裸 HTML | fenced-preserve(spike 决断) |
| whitespace.md | 空白/空行/硬换行 | mdast-equal |
| tables.md | GFM 表格与对齐 | mdast-equal |
| codeblock.md | 代码块/嵌套围栏/语言 | mdast-equal |
| tasklist.md | GFM 任务列表 | mdast-equal |
| math.md | 数学公式 inline/block | mdast-equal(依赖 remark-math) |
| links.md | 链接 inline/reference/autolink | mdast-equal |
| images.md | 图片与图片链接 | mdast-equal |
| blockquote.md | 嵌套引用 | mdast-equal |
| lists-nested.md | 有序/无序嵌套、松紧 | mdast-equal |
| headings.md | 一至六级标题 | mdast-equal |
| breaks.md | 硬换行 | mdast-equal |
| thematic-break.md | 分割线 | mdast-equal |
| combined.md | 综合混合文档 | mdast-equal |
## 扩展规则
- 凡报告的往返丢字 bug,先转成新 fixture 再修,回归集只增不减。
- 新增 fixture 在本表追加一行,并标注期望。
## 运行方式(spike/M2 落地后)
- 框架:Vitest;遍历本目录所有 .md(排除 README),逐条 md→PM→md 后按 mdast 等价断言。
- mdast 解析统一用:unified + remark-parse + remark-gfm + remark-math。