Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

4chan code syntax highlighting

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.

Name: Anonymous 2008-06-13 18:01

send us more moderators MVB :(

Name: Anonymous 2008-06-13 18:50

>>1
why does this not work for me?
i see no such code in global.js ;;

Name: Anonymous 2008-06-13 21:53

>>42
Enable Javascript

Name: Anonymous 2008-06-13 22:03

>>43
i have javascript enabled.
the code in >>1 is not in global.js.

Name: Anonymous 2008-06-13 22:06

oh, now it is there.

Name: Anonymous 2008-06-13 22:14

>>45
Fail.

Name: Anonymous 2008-06-13 22:37

>>12
fixed

Name: Anonymous 2008-06-14 19:46

Isn't it time to make the [m] tag the same size as [code]?

Name: Anonymous 2008-06-14 20:10


[penis]
test
[/penis]

Name: Anonymous 2008-06-14 20:23

>>48
It is in IE7 (IM AT WORK FAGOTRS)

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.

Name: Anonymous 2008-06-14 21:16

>>51
You're my bitch, and I like it.

Name: Anonymous 2008-06-15 3:00

>>48
NO. NO!
<tt> looks way better than <code> in MY firefox 2.

Name: Anonymous 2008-06-15 4:32

>>48
why?

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; })

Name: Anonymous 2008-06-15 12:06

>>54
lolol

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; })

Name: Anonymous 2008-06-15 13:02

>>55,57
Please tell me, are we supposed to be impressed by this compiler extension crap?

Name: Anonymous 2008-06-15 13:10

for(;/*/*/0*/**/1;);

Name: Anonymous 2008-06-15 13:16

>>58
just breaking the syntax highlighter.

Name: Anonymous 2008-06-15 15:26

Why would someone do this to us?

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);

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);

Name: Anonymous 2008-06-15 16:29

>>63
See? It failed.

Name: Anonymous 2008-06-15 16:48

^-,-^   , Durrr
#''#
  A

Name: Anonymous 2008-06-15 17:08

//this is a comment??/
class X ??<
  int y;
??>

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

Name: Anonymous 2008-06-17 15:43

Name: Anonymous 2009-02-25 7:47

Clientlist?

Name: Trollbot9000 2009-07-01 9:55


Plisp.

Name: Anonymous 2010-12-21 16:18

Name: Sgt.Kabukiman힡疝 2012-05-24 6:02

All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy

Name: bampu pantsu 2012-05-29 3:49

bampu pantsu

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List