Re:Show HN: HTMLify - Turn code snippets into HTML, for tech...
by buttscicles on Saturday May 18, 2013 @08:06AM
(#5728628)
Pygments (http://pygments.org/) is the best Python library for this. (op is using Django)
It's pretty configurable, and outputs something like this (both the pastebin and linked paste make use of it):
https://paste.buttscicl.es/u/877a8d68d88239985e6bb39a4ccaa81...
This seems like a slightly extended htmlentities(nl2br($input)) (if done in php). handy in those times you need stuff converted so it'll output the same way as what you are pasting in.