blocks in HTML?
(One suggestion per answer please).
StackOverflow uses the Prettify library.
I recently developed one called rainbow.
The main design goal was to make the core library really small and make it really easy for developers to extend.
It supports such things as
pre blocks, able to use classnames like
data-sh or via specifying options at initialisation. A great stable choice which is updated regularly.
What about Prism by Lea Verou.
From her blog post announcement in June (2012):
- It’s tiny. The core is only 1.5KB minified & gzipped.
- It’s incredibly extensible. Not only it’s easy to add new languages (that’s a given with every syntax highlighter these days), but also to
extend existing ones.
- It supports parallelism through Web Workers, for better performance in certain cases.
- It doesn’t force you to use any Prism-specific markup, not even a Prism-specific class name, only standard markup you should be using
anyway. So, you can just try it for a while, remove it if you don’t
like it and leave no traces behind.