Skip to content

Commit 6d4de9f

Browse files
committed
Updated regex to exclude trailing escape characters and quotes
1 parent 1b0d116 commit 6d4de9f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

scripts/checkDeadLinks.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ const glob = require('glob');
1313
* @returns {string[]} - Array of extracted links.
1414
*/
1515
function extractLinks(content) {
16-
const regex = /https?:\/\/[^\s,")]+/g;
17-
return content.match(regex) || [];
16+
const regex = /https?:\/\/[^\s,")>\\]+/g;
17+
const rawLinks = content.match(regex) || [];
18+
return rawLinks.map(link => link.replace(/[\\"]+$/, '')); // Remove trailing backslashes and quotes
1819
}
1920

2021
/**

0 commit comments

Comments
 (0)