提交 c8a9a487 编写于 作者: D DCloud_LXH

chore: add base to md

上级 dc11b380
......@@ -10,7 +10,8 @@ module.exports = function (md, { base = '/' }) {
if (attr[0] === 'href') {
// /abc/def.md => ${base}/abc/def.md
if (attr[1].indexOf('/') === 0 && attr[1].indexOf(base) !== 0) attr[1] = base + attr[1].slice(1)
if (/^\w/.test(attr[1])) attr[1] = './' + attr[1]
// abc/def.md => ./abc/def.md
if (/^\w/.test(attr[1]) && !/^\w+:/.test(attr[1])) attr[1] = './' + attr[1]
}
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册