feat: 测试开发学习路径上线阶段 2 模块 3、4(26 章 / 120 小节)

- 新增 modules/s2-03-api-framework(接口自动化测试框架,13 章 / 60 小节)
- 新增 modules/s2-04-ui-automation(UI 自动化:Playwright 与 Selenium,13 章 / 60 小节)
- index.html 的 PAGES 登记 s2-2 / s2-3;modules-plan.json 完善这两个模块的导语
- 工具链修正:链接检查跳过 pre 内部(代码块里的 href 文本是被讲的文本,不是死链)
- 工具链修正:模块目录页「约 N 千字」改为只数正文(剥掉侧栏目录树与代码块),全站口径统一
- README 更新进度表、阶段 2 模块表与目录结构
- 自检:check-chapter --strict 26 页通过、check-pages 163 页通过、check-glossary 162 页无漂移、portal 注册表通过
This commit is contained in:
2026-10-16 15:38:20 +08:00
parent 100f235e3f
commit 327b080b02
44 changed files with 14642 additions and 24 deletions

View File

@@ -162,8 +162,9 @@ for (const p of files) {
// 残留占位
if (/<!--\s*(MORE|TODO|PART\d|占位)/i.test(html)) problems.push(`${rel}: 有未完成的占位注释`);
// 链接与锚点
const links = [...markup.matchAll(/href="(?!https?:|mailto:)([^"]+)"/g)].map(m => m[1]);
// 链接与锚点(排除 <pre> 内部:代码块里的 href="/cart" 是「被讲的文本」,不是真链接)
const linkScope = markup.replace(/<pre[\s\S]*?<\/pre>/g, "");
const links = [...linkScope.matchAll(/href="(?!https?:|mailto:)([^"]+)"/g)].map(m => m[1]);
for (const l of new Set(links)) {
const [file, hash] = l.split("#");
const target = file ? path.resolve(path.dirname(p), file) : path.resolve(p);