Showing a code snippet in an HTML page

∥☆過路亽.° 提交于 2019-12-11 01:07:59

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!