Skip to content

Commit c987ada

Browse files
committed
Docs: Ensure URLs without .html are properly redirected.
1 parent d302ce4 commit c987ada

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/page.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ if ( ! window.frameElement && window.location.protocol !== 'file:' ) {
1717

1818
}
1919

20-
const pathSnippet = href.slice( splitIndex, - 5 );
20+
const extension = href.split( '.' ).pop();
21+
const end = ( extension === 'html' ) ? - 5 : href.length;
22+
const pathSnippet = href.slice( splitIndex, end );
2123

2224
window.location.replace( docsBaseURL + '#' + pathSnippet + hash );
2325

0 commit comments

Comments
 (0)