diff --git a/src/utils.js b/src/utils.js index a53a8c9..7ac78f8 100644 --- a/src/utils.js +++ b/src/utils.js @@ -119,7 +119,7 @@ module.exports = function(redis) { href = `${protocol}${config.domain}${href}` let u = new URL(href) u.searchParams.append('lang', lang) - href = u.href + href = `${u.pathname}${u.search}` links[i].setAttribute('href', href) } } @@ -184,7 +184,7 @@ module.exports = function(redis) { // replace wiki links const wiki_href_regx = /(href=\"(https:|http:|)\/\/([A-z.-]+\.)?(wikipedia.org|wikimedia.org|wikidata.org|mediawiki.org))/gm - data.html = data.html.replace(wiki_href_regx, `href="${protocol}${config.domain}`) + data.html = data.html.replace(wiki_href_regx, 'href="') /** * If we are on DownloadAsPdf page, we have to inject a input which