From 8926e953b748680252acbf243afd31054ae7d146 Mon Sep 17 00:00:00 2001 From: wgroeneveld Date: Wed, 17 Mar 2021 18:54:07 +0100 Subject: [PATCH] replaceAll is node15+ --- src/webmention/rsslinkcollector.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/webmention/rsslinkcollector.js b/src/webmention/rsslinkcollector.js index c518c0c..9c47063 100644 --- a/src/webmention/rsslinkcollector.js +++ b/src/webmention/rsslinkcollector.js @@ -12,10 +12,8 @@ const parseOpts = { function collectHrefsFromDescription(description) { // first thought: use parser.parse() and traverse recursively. turned out to be way too slow. - const x = description.match(/href="([^"]*")/g) - console.log(x) - const links = x - .map(match => match.replace("href=", "").replaceAll("\"", "")) + const links = description.match(/href="([^"]*")/g) + .map(match => match.replace("href=", "").replace(/\"/g, "")) .filter(match => !(/\.(gif|zip|rar|bz2|gz|7z|jpe?g|tiff?|png|webp|bmp)$/i).test(match)) .filter(match => !config.disallowedWebmentionDomains.some(domain => match.indexOf(domain) >= 0)) return [...new Set(links)]