diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-03-01 08:13:59 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-03-31 19:19:33 -0300 |
commit | 49240a57e063844387831336908111c0229f5ec0 (patch) | |
tree | 3acb47983de83cce568de166fd8b774a07b330a2 /src | |
parent | b37c0fd26b25a7506731a24f53bd7ae316cc5ea6 (diff) |
data-checks: reportContentTextErrors: report invalid external URLs
Diffstat (limited to 'src')
-rw-r--r-- | src/data/checks.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/data/checks.js b/src/data/checks.js index 79a8d4c9..d42146d4 100644 --- a/src/data/checks.js +++ b/src/data/checks.js @@ -574,6 +574,16 @@ export function reportContentTextErrors(wikiData, { continue; } } + } else if (node.type === 'external-link') { + try { + new URL(node.data.href); + } catch (error) { + yield { + index, length, + message: + `Invalid URL ${colors.red(`"${node.data.href}"`)}`, + }; + } } } } |