提交 aefb7c55 编写于 作者: D DCloud_LXH

chore: normalizeLink

上级 8d070f3f
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册