no idea whats wrong at github

This commit is contained in:
Wouter Groeneveld 2021-03-17 18:49:50 +01:00
parent 632a134fda
commit eac72b0b7b
1 changed files with 3 additions and 1 deletions

View File

@ -12,7 +12,9 @@ const parseOpts = {
function collectHrefsFromDescription(description) {
// first thought: use parser.parse() and traverse recursively. turned out to be way too slow.
const links = description.match(/href="([^"]*")/g)
const x = description.match(/href="([^"]*")/g)
console.log(x)
const links = x
.map(match => match.replace("href=", "").replaceAll("\"", ""))
.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))