Skip to content

Commit

Permalink
Merge pull request #880 from montogeek/gh-pages
Browse files Browse the repository at this point in the history
Fix Keep Markup plugin incorrect highlighting
  • Loading branch information
LeaVerou committed Feb 6, 2016
2 parents ef53322 + 24841ef commit 8f79f3b
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions plugins/keep-markup/prism-keep-markup.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
}

Prism.hooks.add('before-highlight', function (env) {
var firstWhiteSpaces = false;
var pos = 0;
var data = [];
var f = function (elt, baseNode) {
Expand All @@ -21,11 +20,6 @@
if (child.nodeType === 1) { // element
f(child);
} else if(child.nodeType === 3) { // text
if(!firstWhiteSpaces) {
// We need to ignore the first white spaces in the code block
child.data = child.data.replace(/^(?:\r?\n|\r)/, '');
firstWhiteSpaces = true;
}
pos += child.data.length;
}
}
Expand Down Expand Up @@ -94,4 +88,4 @@
});
}
});
}());
}());

0 comments on commit 8f79f3b

Please sign in to comment.