【发布时间】:2017-07-12 06:13:11
【问题描述】:
我使用 Google Code Prettify 来语法高亮我的代码。这是我的 HTML
<head>
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
</head>
<body>
<div id ="xmlView">
<pre class="prettyprint">
<code class="language-xml" id="xmlTextArea"></code>
</pre>
</div>
</body>
当直接在 HTML 中将代码添加到 xmlTextArea 并将所有 替换为 > 和
$('#xmlTextArea').text(code)
之后我也尝试拨打PR.prettyPrint()
【问题讨论】:
标签: javascript jquery html google-code-prettify