Skip to content

Commit 0865c4d

Browse files
committed
Meta: make link-fixup.js only look at the path for 404s
The Table of Contents link to index.html was redirected to indices.html#index, and similarly all multipage pages without a hash was being redirected (sometimes correctly, sometimes not).x
1 parent d033b46 commit 0865c4d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

link-fixup.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
xhr.onload = function() {
1717
var fragmentLinks = xhr.response;
1818

19-
// handle section-foo.html links from the old old multipage version,
20-
// and broken foo.html from the new version
21-
if (!fragid || !(fragid in fragmentLinks)) {
19+
// Handle section-foo.html links from the old old multipage version,
20+
// and broken foo.html from the new version. Only run this for 404s.
21+
if ((!fragid || !(fragid in fragmentLinks)) && document.title === '404 Not Found') {
2222
var m = window.location.pathname.match(/\/(?:section-)?([\w\-]+)\.html/);
2323
if (m) {
2424
fragid = m[1];

0 commit comments

Comments
 (0)