首页 新闻 会员 周边 捐助

为什么用highlight.js无法对代码高亮?

0
悬赏园豆:20 [已关闭问题] 关闭于 2016-06-18 14:17
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>title</title>
    <link rel="stylesheet" href="assets/css/bootstrap.min.css">
    <link rel="stylesheet" href="assets/css/monokai.css">
  </head>
  <body>
    <nav class="navbar navbar-default navbar-inverse">
      <div class="container">
        <div class="navbar-header">
          <a class="navbar-brand" href="#">Wiki</a>
        </div>
        <div>
          <ul class="nav navbar-nav">
            <li><a href="#">Home</a></li>
            <li><a href="#">About</a></li>
            <li><a href="#">Fuck</a></li>
          </ul>
        </div>
      </div>
    </nav>
    
<pre><code class="cpp">#include &lt;iostream&gt;

int main(int argc, char *argv[]) {

  /* An annoying &quot;Hello World&quot; example */
  for (auto i = 0; i &lt; 0xFFFF; i++)
    cout &lt;&lt; &quot;Hello, World!&quot; &lt;&lt; endl;

  char c = &#39;\n&#39;;
  unordered_map &lt;string, vector&lt;string&gt; &gt; m;
  m[&quot;key&quot;] = &quot;\\\\&quot;; // this is an error

  return -2e3 + 12l;
}
    <script type="text/javascript" src="assets/js/jquery.min.js"/>
    <script type="text/javascript" src="assets/js/bootstrap.min.js"/>
    <script type="text/javascript" src="assets/js/highlight.pack.js"/>
    <script>
      hljs.initHighlightingOnLoad();
    </script>
  </body>
</html>

ii沙漠的主页 ii沙漠 | 初学一级 | 园豆:114
提问于:2016-06-18 14:06
< >
分享
所有回答(1)
0

懂了,原来是script脚本写错了。 。。。

ii沙漠 | 园豆:114 (初学一级) | 2016-06-18 14:17
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册