From aefb7c5523d6ef43a4effa34eac9f07b6a14c6b7 Mon Sep 17 00:00:00 2001 From: DCloud_LXH <283700113@qq.com> Date: Wed, 23 Mar 2022 15:34:38 +0800 Subject: [PATCH] chore: normalizeLink --- docs/.vuepress/markdown/normallizeLink.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/.vuepress/markdown/normallizeLink.js b/docs/.vuepress/markdown/normallizeLink.js index f89fe23bc..2f3e85984 100644 --- a/docs/.vuepress/markdown/normallizeLink.js +++ b/docs/.vuepress/markdown/normallizeLink.js @@ -18,7 +18,14 @@ function normalizeLink(url) { module.exports = function (md) { md.normalizeLink = (function (oldNormalizeLink) { return function (url) { - url = isExternal(url) ? url : normalizeLink(url).replace('.md', '') + url = isExternal(url) + ? url + : normalizeLink(url) + .replace(/\.md\b/, '') + .replace(/\bREADME\b/, '') + .replace(/\/index/, '/') + .replace(/\?id=/, '#') + .replace(/\\/g, '/') return oldNormalizeLink.bind(this)(url) } })(md.normalizeLink) -- GitLab