Update cli.js

This commit is contained in:
Max Schmitt 2024-04-03 17:51:12 +02:00 committed by GitHub
parent 203027b449
commit 38c2fe90db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -221,6 +221,7 @@ async function run() {
} }
if (!node.text) if (!node.text)
return; return;
// Match links in a lax way (.+), so they can include spaces, backticks etc.
for (const [, mdLinkName, mdLink] of node.text.matchAll(/\[(.+)\]\((.*?)\)/g)) { for (const [, mdLinkName, mdLink] of node.text.matchAll(/\[(.+)\]\((.*?)\)/g)) {
const isExternal = mdLink.startsWith('http://') || mdLink.startsWith('https://'); const isExternal = mdLink.startsWith('http://') || mdLink.startsWith('https://');
if (isExternal) if (isExternal)