doc: link error, close #5652
parent
9b0fb707e2
commit
d5bb271dd8
|
@ -45,10 +45,10 @@ export const linkPlugin = (md: MarkdownIt, externalAttrs: Record<string, string>
|
||||||
if (cleanUrl.endsWith('.md')) {
|
if (cleanUrl.endsWith('.md')) {
|
||||||
cleanUrl = cleanUrl.replace(/\.md$/, '.html');
|
cleanUrl = cleanUrl.replace(/\.md$/, '.html');
|
||||||
}
|
}
|
||||||
// ./foo -> ./foo.html
|
// // ./foo -> ./foo.html
|
||||||
if (!cleanUrl.endsWith('.html') && !cleanUrl.endsWith('/')) {
|
// if (!cleanUrl.endsWith('.html') && !cleanUrl.endsWith('/')) {
|
||||||
cleanUrl += '.html';
|
// cleanUrl += '.html';
|
||||||
}
|
// }
|
||||||
const parsed = new URL(url, 'http://a.com');
|
const parsed = new URL(url, 'http://a.com');
|
||||||
url = cleanUrl + parsed.search + parsed.hash;
|
url = cleanUrl + parsed.search + parsed.hash;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue