Skip to content

Commit c79c971

Browse files
committed
chore(docs): 统一 docs-check 为单一权威副本
1 parent 19dd9e1 commit c79c971

2 files changed

Lines changed: 4 additions & 199 deletions

File tree

‎docs/scripts/docs-check.mjs‎

Lines changed: 0 additions & 198 deletions
This file was deleted.

‎scripts/docs-check.mjs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,12 @@ function collectMd(dir) {
6565
/** 提取 markdown 链接目标(忽略外部 URL/锚点/图片),区分相对与 file:// */
6666
function extractLinks(content) {
6767
const links = [];
68+
// 先剔除围栏代码块与行内代码:代码示例中的 ](...) 模式不是真实链接,
69+
// 不剔除会把配图格式示例等误判为失效链接(v0.10.1.md 实证,2026-08-21 十轮修复)
70+
const stripped = content.replace(/```[\s\S]*?```/g, '').replace(/`[^`\n]*`/g, '');
6871
const re = /\[[^\]]*\]\(([^)]+)\)/g;
6972
let m;
70-
while ((m = re.exec(content)) !== null) {
73+
while ((m = re.exec(stripped)) !== null) {
7174
const target = m[1].trim();
7275
if (!target || target.startsWith('#')) continue;
7376
if (/^(https?:|mailto:|data:)/.test(target)) continue;

0 commit comments

Comments
 (0)