Update DiscordPreview.js
This commit is contained in:
parent
600de7e83d
commit
a32e030450
|
@ -39,12 +39,13 @@ window.onmessage = function (e) {
|
||||||
else document.body.innerHTML = document.body.innerHTML.replace(new RegExp(e.data.light, "g"), e.data.dark);
|
else document.body.innerHTML = document.body.innerHTML.replace(new RegExp(e.data.light, "g"), e.data.dark);
|
||||||
break;
|
break;
|
||||||
case "Normalize":
|
case "Normalize":
|
||||||
var oldhtml = document.body.innerHTML.split(/'class:"'|"/g);
|
var oldhtml = document.body.innerHTML.split('class="');
|
||||||
var newhtml = oldhtml.shift();;
|
var newhtml = oldhtml.shift();
|
||||||
for (let html of oldhtml) {
|
for (let html of oldhtml) {
|
||||||
html = html.split('"');
|
html = html.split('"');
|
||||||
newhtml += (e.data.checked ? html[0].replace(/([A-z0-9]+?)-([A-z0-9_-]{6})(["| ])/g, "$1-$2 da-$1$3") : html[0].split(" ").filter(n => n.indexOf("da-") != 0).join(" ")) + html[1];
|
newhtml += "class=" + (e.data.checked ? html[0].replace(/([A-z0-9]+?)-([A-z0-9_-]{6})(["| ])/g, "$1-$2 da-$1$3") : html[0].split(" ").filter(n => n.indexOf("da-") != 0).join(" ")) + html[1];
|
||||||
}
|
}
|
||||||
|
document.body.innerHTML = newhtml.join(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue