Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit def5991

Browse files
committed
fix catch-links when no href
1 parent 7df64e8 commit def5991

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

lib/catch-links.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@ module.exports = function (root, cb) {
1616

1717
let href = anchor.getAttribute('href')
1818

19-
if (href.startsWith('#')) {
20-
try {
21-
href = decodeURIComponent(href)
22-
} catch (e) {
23-
// Safely ignore error because href isn't URI-encoded.
24-
}
25-
}
26-
2719
if (href) {
20+
if (href.startsWith('#')) {
21+
try {
22+
href = decodeURIComponent(href)
23+
} catch (e) {
24+
// Safely ignore error because href isn't URI-encoded.
25+
}
26+
}
2827
let isUrl
2928
let url
3029

0 commit comments

Comments
 (0)