syntaxhighlighter语法高亮
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Hello SyntaxHighlighter</title> <script type="text/javascript" src="scripts/shCore.js"></script> <script type="text/javascript" src="scripts/shBrushJScript.js"></script> <script type="text/javascript" src="scripts/shBrushPhp.js"></script> <script type="text/javascript" src="scripts/shBrushXml.js"></script> <link type="text/css" rel="stylesheet" href="styles/shCoreDefault.css"/> <script type="text/javascript">SyntaxHighlighter.defaults['toolbar'] = false;</script> <script type="text/javascript">SyntaxHighlighter.all();</script> </head> <body style="background: white; font-family: Helvetica"> <h1>Hello SyntaxHighlighter</h1> <pre class="brush: js;"> function helloSyntaxHighlighter() { return "hi!"; } </pre> <pre class="brush: php; highlight: [1, 3]; html-script: false"> $test = '123'; echo $test; var_dump($test); function escape($string) { return addslashes(htmlspecialchars($string, ENT_QUOTES, 'UTF-8')); } </pre> <pre class="brush: html;"> <a href="">xxxx</a> </pre> </html>