HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

GoogleCodePrettify 0.3

Adds google-code-prettify (http://code.google.com/p/google-code-prettify/) to discussion pages.

Adds google-code-prettify (http://code.google.com/p/google-code-prettify/) to discussion pages. This will enable syntax highlighting inside <code class="prettyprint"> blocks in comments.

Simple usage:
<code class="prettyprint">var x = 1;
doSomething();</code>

That will produce:
image

With line numbers:
<code class="prettyprint linenums">var x = 1;
doSomething();</code>

That will produce:
image

See http://google-code-prettify.googlecode.com/svn/trunk/README.html for full usage details.

History:
2010-10-23 v0.2: Removed HEREDOC which was breaking on some servers
2010-10-22 v0.1: Initial upload

TODO:

  • run prettyPrint() again when a comment is edited inline
  • limit plugin to pages with comments

Questions