Skip to content

Commit

Permalink
Line Highlight: Don't wait for the Line numbers plugin to load if the…
Browse files Browse the repository at this point in the history
… element does not have the line-numbers class
  • Loading branch information
Golmote committed Dec 5, 2017
1 parent d899989 commit 3842a91
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugins/line-highlight/prism-line-highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Prism.hooks.add('complete', function completeHook(env) {
var hasLineNumbers = Prism.plugins.lineNumbers;
var isLineNumbersLoaded = env.plugins && env.plugins.lineNumbers;

if (hasLineNumbers && !isLineNumbersLoaded) {
if (hasClass(pre, 'line-numbers') && hasLineNumbers && !isLineNumbersLoaded) {
Prism.hooks.add('line-numbers', completeHook);
} else {
highlightLines(pre, lines);
Expand Down
2 changes: 1 addition & 1 deletion plugins/line-highlight/prism-line-highlight.min.js

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

0 comments on commit 3842a91

Please sign in to comment.