Skip to content

Instantly share code, notes, and snippets.

@dlimpid
Created January 11, 2015 17:32
Show Gist options
  • Save dlimpid/e84edee8fb393acaf685 to your computer and use it in GitHub Desktop.
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
<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