Skip to content

Commit

Permalink
Line-numbers: Abort if element is empty. Fixex #669
Browse files Browse the repository at this point in the history
  • Loading branch information
Golmote committed Aug 15, 2015
1 parent 28e329c commit ee463e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions plugins/line-numbers/prism-line-numbers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Prism.hooks.add('complete', function (env) {
if (!env.code) {
return;
}

// works only for <code> wrapped inside <pre> (not inline)
var pre = env.element.parentNode;
var clsReg = /\s*\bline-numbers\b\s*/;
Expand Down
2 changes: 1 addition & 1 deletion plugins/line-numbers/prism-line-numbers.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ee463e8

Please sign in to comment.