fix: broken links to same page heading, fix #278, fix #279

This commit is contained in:
qingwei.li 2017-10-15 10:43:35 +08:00
parent 26cc466420
commit 91d6337936

View File

@ -81,7 +81,9 @@ export class HashHistory extends History {
path = path.replace(/\.md(\?)|\.md$/, '$1')
if (local) {
path = currentRoute.substr(0, currentRoute.indexOf('?')) + path
const idIndex = currentRoute.indexOf('?')
path =
(idIndex > 0 ? currentRoute.substr(0, idIndex) : currentRoute) + path
}
return cleanPath('#/' + path)