Last active
January 30, 2016 04:15
-
-
Save EbiseLutica/a032e3748f833bedbb09 to your computer and use it in GitHub Desktop.
This file contains 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
[].forEach.call(document.querySelectorAll('pre > code'), function(elem){ | |
// highlight.js は <code> 内の先頭と末尾の改行を無視してくれないので、ここで削除 | |
// ※ HTML を書く際、先頭と末尾に改行を入れない方法もある | |
elem.textContent = elem.textContent.replace(/^[\r\n]+|[\r\n]+$/g, ''); | |
// highlight.js の適用 | |
hljs.highlightBlock(elem); | |
// highlightjs-line-numbers.js の適用 | |
hljs.lineNumbersBlock(elem); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment