summaryrefslogtreecommitdiffhomepage
path: root/plugin/highlight/highlight.js
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/highlight/highlight.js')
-rw-r--r--plugin/highlight/highlight.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugin/highlight/highlight.js b/plugin/highlight/highlight.js
index e50676f..776f09c 100644
--- a/plugin/highlight/highlight.js
+++ b/plugin/highlight/highlight.js
@@ -117,6 +117,9 @@ c:[{cN:"comment",b:/\(\*/,e:/\*\)/},e.ASM,e.QSM,e.CNM,{b:/\{/,e:/\}/,i:/:/}]}});
hljs.highlightBlock( block );
+ // Don't generate line numbers for empty code blocks
+ if( block.innerHTML.trim().length === 0 ) return;
+
if( block.hasAttribute( 'data-line-numbers' ) ) {
hljs.lineNumbersBlock( block, { singleLine: true } );