Added partial BreezWiki Copy Raw support https://github.com/libredirect/libredirect/issues/513
This commit is contained in:
parent
ad4c00e663
commit
c19491edc0
|
@ -413,7 +413,7 @@ function redirect(url, type, initiator, forceRedirection) {
|
|||
if (url.hostname.match(/^[a-zA-Z0-9-]+\.fandom\.com/)) {
|
||||
wiki = url.hostname.match(/^[a-zA-Z0-9-]+(?=\.fandom\.com)/)
|
||||
if (wiki == "www" || !wiki) wiki = ""
|
||||
else wiki = "/" + wiki
|
||||
else wiki = `/${wiki}`;
|
||||
urlpath = url.pathname
|
||||
} else {
|
||||
wiki = url.pathname.match(/(?<=wiki\/w:c:)[a-zA-Z0-9-]+(?=:)/)
|
||||
|
@ -545,6 +545,14 @@ function reverse(url, urlString) {
|
|||
if (!urlString) resolve(config.services[service].url + url.pathname + url.search)
|
||||
else resolve(url.replace(/https?:\/{2}(?:[^\s\/]+\.)+[a-zA-Z0-9]+/, config.services[service].url))
|
||||
return
|
||||
case "fandom":
|
||||
let regex = url.pathname.match(/^\/([a-zA-Z0-9-]+)\/wiki\/([a-zA-Z0-9-]+)/)
|
||||
if (regex) {
|
||||
resolve(`https://${regex[1]}.fandom.com/wiki/${regex[2]}`)
|
||||
return
|
||||
}
|
||||
resolve()
|
||||
return
|
||||
default:
|
||||
resolve()
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue