We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e4c790 commit ac5ed77Copy full SHA for ac5ed77
src/core/router/history/hash.js
@@ -8,6 +8,10 @@ function replaceHash(path) {
8
location.replace(location.href.slice(0, i >= 0 ? i : 0) + '#' + path);
9
}
10
11
+function endsWith(str, suffix) {
12
+ return str.indexOf(suffix, str.length - suffix.length) !== -1;
13
+}
14
+
15
export class HashHistory extends History {
16
constructor(config) {
17
super(config);
@@ -23,7 +27,7 @@ export class HashHistory extends History {
23
27
// prevents the `/index.html` part of the URI from being
24
28
// remove during routing.
25
29
// See here: https://github.com/docsifyjs/docsify/pull/1372
26
- const basePath = path.endsWith('.html')
30
+ const basePath = endsWith(path, '.html')
31
? path + '#/' + base
32
: path + '/' + base;
33
return /^(\/|https?:)/g.test(base) ? base : cleanPath(basePath);
0 commit comments