Display code (HTML, CSS, PHP, JavaScript, jQuery, etc.) on a webpage, just like code is displayed here, in a box, syntax-highlighted

后端 未结 5 1695
不知归路
不知归路 2021-02-20 06:07

I\'d like to display code on a web page. However I\'d like it to keep its spacing and be color coded by syntax.

Please do not respond with:

5条回答
  •  臣服心动
    2021-02-20 06:42

    I use the syntax highlighter from Alex Gorbatchev (JavaScript).

    See http://alexgorbatchev.com/SyntaxHighlighter/manual/installation.html for instructions. But if you need to support displaying HTML containing script elements, you'll need to fall back to the

     method, and thus escape <, > and &. 

提交回复
热议问题