basic code embeds (html escaped no style)

This commit is contained in:
2021-01-28 03:10:54 +01:00
parent e0ec96562d
commit 440b59f3c9
8 changed files with 860 additions and 2 deletions

16
src/js/steevcss.js Normal file
View File

@@ -0,0 +1,16 @@
var code = document.querySelectorAll("code");
code.forEach(c => {
let code = c.innerHTML.toString();
var output = "";
for(let i = 0; i < code.length; i++){
switch(code.charAt(i)){
default: output += code.charAt(i); break;
case ">": output += "&gt;"; break;
case "<": output += "&lt;"; break;
case "&": output += "&amp;"; break;
case "\"": output += "&quot;"; break;
}
}
c.innerHTML = output;
})