Skip to content

Commit 7d5d952

Browse files
committed
Also use origin for anchors
1 parent 1b4a441 commit 7d5d952

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

htmlpreview.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
// Check if it's an anchor
202202
if (href.indexOf('#') > 0) {
203203
// Rewrite links to this document only
204-
if ((a[i].protocol + '//' + a[i].hostname + a[i].pathname) == rawFileUrl) {
204+
if ((a[i].origin + a[i].pathname) == rawFileUrl) {
205205
// Then rewrite URL with support for empty anchor
206206
a[i].href
207207
= location.origin + location.pathname + location.search

0 commit comments

Comments
 (0)