Skip to content

Commit

Permalink
work around syntax highlighter stripping leading blank lines
Browse files Browse the repository at this point in the history
  • Loading branch information
haarg committed Oct 13, 2014
1 parent a34ebcb commit 72e5b1a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions root/static/js/syntaxhighlighter.js
Expand Up @@ -147,6 +147,13 @@ $(function () {
config.highlight = parseLines(lines);
}

// highlighter strips leading blank lines, throwing off line numbers.
// add a blank line for the highlighter to strip
var html = $(code).html();
if (html.match(/^ *\n/)) {
$(code).html("\n " + html);
}

SyntaxHighlighter.highlight(config, code);

var pod_lines = pre.attr('data-pod-lines');
Expand Down

0 comments on commit 72e5b1a

Please sign in to comment.