fix: Chinese file link build failed (#425)

fix #424
pull/486/head
fuchunhui 4 years ago committed by GitHub
parent a3bf52fed5
commit ae029ae9e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -89,10 +89,12 @@ export function createMarkdownToVueRenderFn(
for (let url of data.links) { for (let url of data.links) {
url = url.replace(/[?#].*$/, '').replace(/\.(html|md)$/, '') url = url.replace(/[?#].*$/, '').replace(/\.(html|md)$/, '')
if (url.endsWith('/')) url += `index` if (url.endsWith('/')) url += `index`
const resolved = slash( const resolved = decodeURIComponent(
url.startsWith('/') slash(
? url.slice(1) url.startsWith('/')
: path.relative(srcDir, path.resolve(dir, url)) ? url.slice(1)
: path.relative(srcDir, path.resolve(dir, url))
)
) )
if ( if (
!pages.includes(resolved) && !pages.includes(resolved) &&

Loading…
Cancel
Save