Commit 8f52f9e
committed
fix(seo): address CR — detect h1 anywhere in mdx tree
Copilot CR: `tree.children.some(...)` 只看顶级子节点,h1 嵌套在
blockquote / list 里(markdown 允许 \`> # title\`)会漏判。
改用 visit 整树扫描检测 h1。代价是多一次 traversal(约几十微秒每文档),
确保所有位置的 h1 都被识别并触发整树 demote。1 parent 5410caa commit 8f52f9e
1 file changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
63 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
| |||
0 commit comments