Created
January 11, 2015 17:32
-
-
Save dlimpid/e84edee8fb393acaf685 to your computer and use it in GitHub Desktop.
Add `plain` style for highlight.js: no syntax highlight but apply same css style with highlighted code block
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<pre><code class="c">Block 1</code></pre> | |
<pre><code class="nohighlight">Block 2: The style of this block is different from Block 1.</code></pre> | |
<pre><code class="language-plain">Block 3: The style is the same with Block 1! :)</code></pre> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script> | |
<!-- ... load another languages ... --> | |
<script> | |
hljs.registerLanguage('plain', function(hljs) { | |
return { case_insensitive: true, keywords: '', contains: [] }; | |
}); | |
hljs.initHighlightingOnLoad(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment