mirror of https://github.com/dirtbags/moth.git
oops, checked in some non-working experimental code
This commit is contained in:
parent
2f2fd51607
commit
10daac3988
|
@ -41,7 +41,7 @@ function init() {
|
||||||
|
|
||||||
// Prefix `base` to relative URLs in the puzzle body
|
// Prefix `base` to relative URLs in the puzzle body
|
||||||
let doc = new DOMParser().parseFromString(obj.body, "text/html");
|
let doc = new DOMParser().parseFromString(obj.body, "text/html");
|
||||||
for (let se of doc.querySelectorAll("[src,href]")) {
|
for (let se of doc.querySelectorAll("[src],[href]")) {
|
||||||
se.outerHTML = se.outerHTML.replace(/(src|href)="([^/]+)"/i, "$1=\"" + base + "$2\"");
|
se.outerHTML = se.outerHTML.replace(/(src|href)="([^/]+)"/i, "$1=\"" + base + "$2\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue