引入highlight.js和渲染样式css
引自Bootstrap的OPEN CND,国内访问快。
<script src="//cdn.bootcss.com/highlight.js/9.0.0/highlight.min.js"></script>
<link href="//cdn.bootcss.com/highlight.js/9.0.0/styles/vs.min.css" rel="stylesheet">
寻找代码高亮
highlight.js寻找当前html页面中的<pre><code></code></pre>
进行渲染
<script >hljs.initHighlightingOnLoad();</script>
详见
<!--
font-family:Consolas,"Helvetica Neue","Microsoft YaHei","Hiragino Sans GB";
-->