Skip to content

Commit

Permalink
Fix links
Browse files Browse the repository at this point in the history
  • Loading branch information
liulex committed Oct 24, 2024
1 parent bbced49 commit c6615ac
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,13 @@
// replace wiki links to docs.snipaste.com
hook.beforeEach(function(content) {
if (content == null)
return null
// en pages
content = content.replace(new RegExp("\\]\\(" + wiki + "([a-zA-Z\\-]+)", "g"), function (a, m) { return '](/' + m.toLowerCase() })
// zh pages
return null;
for (var w in w2d) {
content = content.replace(new RegExp("\\]\\(" + wiki + w, "g"), '](' + w2d[w]).replace(new RegExp("\\]\\(" + wiki + encodeURI(w), "g"), '](' + w2d[w])
content = content.replace(new RegExp("\\]\\(" + wiki + w, "g"), '](' + w2d[w]).replace(new RegExp("\\]\\(" + wiki + encodeURI(w), "g"), '](' + w2d[w]);
}
return content
// general en pages
content = content.replace(new RegExp("\\]\\(" + wiki + "([a-zA-Z\\-]+)", "g"), function (a, m) { return '](/' + m.toLowerCase() });
return content;
})
}
]
Expand Down

0 comments on commit c6615ac

Please sign in to comment.