Skip to content

Commit

Permalink
no line numbers if already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
manfer committed Aug 9, 2015
1 parent f237e67 commit c89bbdb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugins/line-numbers/prism-line-numbers.js
Expand Up @@ -10,6 +10,11 @@ Prism.hooks.add('complete', function (env) {
return;
}

if ( env.element.querySelector(".line-numbers-rows") ) {
// Abort if line numbers already exists
return;
}

if (clsReg.test(env.element.className)) {
// Remove the class "line-numbers" from the <code>
env.element.className = env.element.className.replace(clsReg, '');
Expand Down

0 comments on commit c89bbdb

Please sign in to comment.