Name: Anonymous 2008-06-12 7:12
tl;dr summary: everything inside [code]..[/code] tags is now showing Javascript syntax highlighting
Seeing odd colours in posts, I WTF'd for a while, until I found this buried in http://dis.4chan.org/script/global.js:
Basically if it finds any code tags on a page, it loads http://dis.4chan.org/script/prettify.js and applies it to them.
Seeing odd colours in posts, I WTF'd for a while, until I found this buried in http://dis.4chan.org/script/global.js:
function loadSyntaxHighlighter() {
var code = document.getElementsByTagName("code");
if (code.length) {
var head = document.getElementsByTagName("head")[0];
for (var i=0; i < code.length; i++) {
code[i].setAttribute("class", "prettyprint");
}
var prettify = document.createElement("script");
prettify.src = "script/prettify.js";
prettify.type = "text/javascript";
head.appendChild(prettify);
}
}Basically if it finds any code tags on a page, it loads http://dis.4chan.org/script/prettify.js and applies it to them.