diff --git a/command/wait.md b/command/wait.md index 2d1796719e..4066d93e5b 100644 --- a/command/wait.md +++ b/command/wait.md @@ -39,4 +39,4 @@ wait 27156 输出当前存在作业号的指令,如下所示: -[jobs](https://wangchujiang.com/linux-command/c/jobs.html) +[jobs](./jobs.md) diff --git a/scripts/build.mjs b/scripts/build.mjs index f7c13b392e..35ef657e1c 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -217,7 +217,15 @@ const contributorsPath = path.resolve(process.cwd(), 'CONTRIBUTORS.svg'); } function markdownToHTML(str) { - return create({ markdown: str, document: undefined, 'dark-mode': false }); + return create({ + rewrite: (node) => { + if (node.type === 'element' && node.properties?.href && /.md/.test(node.properties.href) && !/^(https?:\/\/)/.test(node.properties.href)) { + let href = node.properties.href; + node.properties.href = href.replace(/([^\.\/\\]+)\.(md|markdown)/gi, '$1.html'); + } + }, + markdown: str, document: undefined, 'dark-mode': false + }); } /**