File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,10 @@ function replaceHash(path) {
8
8
location . replace ( location . href . slice ( 0 , i >= 0 ? i : 0 ) + '#' + path ) ;
9
9
}
10
10
11
+ function endsWith ( str , suffix ) {
12
+ return str . indexOf ( suffix , str . length - suffix . length ) !== - 1 ;
13
+ }
14
+
11
15
export class HashHistory extends History {
12
16
constructor ( config ) {
13
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' )
27
31
? path + '#/' + base
28
32
: path + '/' + base ;
29
33
return / ^ ( \/ | h t t p s ? : ) / g. test ( base ) ? base : cleanPath ( basePath ) ;
You can’t perform that action at this time.
0 commit comments