Automatic syntax highlighting

I'm looking for a nice full-screen syntax shortcut written in JavaScript that will automatically detect the language being used and apply the correct syntax highlighting.

I found a bunch of them from a simple google search, but they should all have some sort of formatted class on the element <pre>

, eg <pre class="highlight-php">

.

I noticed that StackOverflow syntax highlighting allows this to be done automatically from pre-blocks, does anyone know which library they are using?

Thank!

+3


source to share


1 answer


They use google prettify . There are other options like highlight.js



+4


source







All Articles