问题
Like there is a code sample inserter in the stackoverflow's WYSIWYG text editor (see image here)
I want such a formatter to show a code snippet in an html page with colored keywords and strings etc. Please help.
回答1:
Check out google code prettify: http://code.google.com/p/google-code-prettify/
回答2:
Check http://code.google.com/p/syntaxhighlighter/ it's pretty popular and awesome.
回答3:
This maybe? http://plugins.jquery.com/plugin-tags/syntax
回答4:
Geshi is quite awesome too: http://qbnz.com/highlighter/demo.php
来源:https://stackoverflow.com/questions/4286834/showing-a-code-snippet-in-an-html-page