1
Highlightjs有非常簡單的usage說明,我似乎無法在下面的文檔中工作。我希望顯示<pre> and <code>
內的html,但我看到的只是文本。我究竟做錯了什麼?基本highlightjs文檔將不起作用
<!DOCTYPE html>
<html lang="en">
<head>
\t <meta charset="UTF-8">
\t <title>Document</title>
\t <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.5/styles/default.min.css">
\t <script src="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.5/highlight.min.js"></script>
\t <script>hljs.initHighlightingOnLoad();</script>
</head>
<body>
\t
<pre>
\t <code class="html">
\t \t <!DOCTYPE html>
\t \t <html lang="en">
\t \t <head>
\t \t \t <meta charset="UTF-8">
\t \t \t <title>Document</title>
\t \t </head>
\t \t <body>
\t \t \t <p>This should be escaped, highlighted html. </p>
\t \t </body>
\t \t </html>
\t </code>
</pre>
</body>
</html>