highlight.js for Markdown uses one colour everywhere -


the official demo of markdown awesome. tried follow guide, result not match expectation, colour of words green.

<!doctype html>  <html>  <head>      <title>highlight.js example</title>      <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.7/styles/darkula.min.css">      <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.7/highlight.min.js"></script>      <script>hljs.inithighlightingonload();</script>  </head>  <body>  <pre><code class="markdown">      # hello world        can write text [with links](http://example.com) inline or [link references][1].        * 1 _thing_ has *em*phasis      * 2 __things__ **bold**        [1]: http://example.com        ---        hello world      ===========        > markdown cool        code segments        1. 1 thing (yeah!)      2. 2 thing `i can write code`, , `more` wipee!  </code></pre>  </body>  </html>

your entire code example indented 4 spaces. in markdown syntax means pre-formatted code, , highlight.js, theme chose, colors code blocks in green.

remove 4 spaces start of each line , works expected.

<!doctype html>  <html>    <head>    <title>highlight.js example</title>    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.7/styles/darkula.min.css">    <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.7/highlight.min.js"></script>    <script>      hljs.inithighlightingonload();    </script>  </head>    <body>    <pre><code class="markdown">  # hello world    can write text [with links](http://example.com) inline or [link references][1].    * 1 _thing_ has *em*phasis  * 2 __things__ **bold**    [1]: http://example.com    ---    hello world  ===========    > markdown cool    code segments    1. 1 thing (yeah!)  2. 2 thing `i can write code`, , `more` wipee!  </code></pre>  </body>    </html>


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -