mirror of
https://github.com/Metastem/wikiless
synced 2024-12-06 19:16:58 +01:00
fix(utils): use path instead of full url
- enables multiple hosts (e.g. onion, eepsite) to share an instance
This commit is contained in:
+2
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user