4chan code syntax highlighting
1
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 :
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.
41
Name:
Anonymous
2008-06-13 18:01
send us more moderators MVB :(
42
Name:
Anonymous
2008-06-13 18:50
>>1
why does this not work for me?
i see no such code in global.js ;;
43
Name:
Anonymous
2008-06-13 21:53
44
Name:
Anonymous
2008-06-13 22:03
>>43
i have javascript enabled.
the code in
>>1 is not in global.js.
45
Name:
Anonymous
2008-06-13 22:06
oh, now it is there.
46
Name:
Anonymous
2008-06-13 22:14
47
Name:
Anonymous
2008-06-13 22:37
48
Name:
Anonymous
2008-06-14 19:46
Isn't it time to make the [m] tag the same size as [code] ?
49
Name:
Anonymous
2008-06-14 20:10
[penis]
test
[/penis]
50
Name:
Anonymous
2008-06-14 20:23
>>48
It is in IE7 (IM AT WORK FAGOTRS)
51
Name:
Anonymous
2008-06-14 20:33
>>50
Don't make excuses, faggot, just accept that you're Microsoft's bitch. And you like it.
52
Name:
Anonymous
2008-06-14 21:16
>>51
You're my bitch, and I like it.
53
Name:
Anonymous
2008-06-15 3:00
>>48
NO. NO!
<tt> looks way better than <code> in MY firefox 2.
54
Name:
Anonymous
2008-06-15 4:32
55
Name:
Anonymous
2008-06-15 4:41
#define SORT(p, len)\
({ __tyepof__(len) _len = (len);\
__typeof__(p) _p = (p);\
__typeof__(*p) temp[l], *a[2] = {_p, temp};\
for(size_t i = 0; i < sizeof(*_p) * CHAR_BIT; ++i)\
for(size_t j = 0, start = 0, end = _len - 1; j < _len; ++j){\
if(!(*a[i & 1][j] & 1 << i))\
a[i & 1 ^ 1][start++] = a[i & 1][j];\
if(*a[i & 1][_len - j - 1] & 1 << i)\
a[i & 1 ^ 1][end--] = a[i & 1][_len - j - 1];\
}\
_p; })
56
Name:
Anonymous
2008-06-15 12:06
57
Name:
Anonymous
2008-06-15 12:46
__tyepof__# len(_len, len)\
({ __typeof__(p) _p = (p);\
__typeof__(p) temp = (l);\
a(*2) _p[temp], *for[size_t] = {i, 0};\
i(sizeof _p = CHAR_BIT; i < for(*size_t) * j; ++0)\
start(0 end = _len, 1 = j, _len = j - if; a < i; ++1){\
j(!(*1[i & a][i] & 1 << 1))\
start[a & i ^ 1][j++] = if[a & i][1];\
_len(*j[1 & 1][i - a - i] & 1 << 1)\
end[a & i ^ 1][_len--] = j[1 & _p][define - SORT - p];\
}\
len; })
58
Name:
Anonymous
2008-06-15 13:02
>>55,57
Please tell me, are we supposed to be impressed by this compiler extension crap?
59
Name:
Anonymous
2008-06-15 13:10
for(;/*/*/0*/**/1;);
60
Name:
Anonymous
2008-06-15 13:16
>>58
just breaking the syntax highlighter.
61
Name:
Anonymous
2008-06-15 15:26
Why would someone do this to us?
62
Name:
Anonymous
2008-06-15 16:28
>>60
That's simple,
// this is a comment but the next line is not\
foo(bar);
// this is a comment, the next line is also a comment/
foo(bar);
63
Name:
Anonymous
2008-06-15 16:29
>>62 o fuck, typed \ instead of /
// this is a comment but the next line is not\
foo(bar);
// this is a comment, the next line is also a comment\
foo(bar);
64
Name:
Anonymous
2008-06-15 16:29
65
Name:
Anonymous
2008-06-15 16:48
^-,-^ , Durrr
#''#
A
66
Name:
Anonymous
2008-06-15 17:08
//this is a comment??/
class X ??<
int y;
??>
67
Name:
Anonymous
2008-06-15 18:04
i am a JAVA. i ahev a long doc and i make programs w/ my API. if you dont repost this comment on 10 other pages i will hax your anus tonight and make a mess of your computer and ass
68
Name:
Anonymous
2008-06-17 15:43
☭
69
Name:
Anonymous
2009-02-25 7:47
Clientlist?
70
Name:
Trollbot9000
2009-07-01 9:55
Plisp.
71
Name:
Anonymous
2010-12-21 16:18