doc: link error, close #5652

pull/5653/head
tangjinzhou 3 years ago
parent 9b0fb707e2
commit d5bb271dd8

@ -45,10 +45,10 @@ export const linkPlugin = (md: MarkdownIt, externalAttrs: Record<string, string>
if (cleanUrl.endsWith('.md')) {
cleanUrl = cleanUrl.replace(/\.md$/, '.html');
}
// ./foo -> ./foo.html
if (!cleanUrl.endsWith('.html') && !cleanUrl.endsWith('/')) {
cleanUrl += '.html';
}
// // ./foo -> ./foo.html
// if (!cleanUrl.endsWith('.html') && !cleanUrl.endsWith('/')) {
// cleanUrl += '.html';
// }
const parsed = new URL(url, 'http://a.com');
url = cleanUrl + parsed.search + parsed.hash;
}

Loading…
Cancel
Save