Skip to content

Commit

Permalink
now syntax highlight properly keeps the new fancy word diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
danielribeiro committed Sep 9, 2014
1 parent fbc9119 commit 0e6e7a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions src/gh-diff-highlight.js
Expand Up @@ -23,14 +23,10 @@ $(function() {
console.log("Applying SyntaxHighlighter from https://chrome.google.com/webstore/detail/gh-diff-highlight/gjljgldconccfbldbnnpbgahpckhjcfj")
$(".blob-code").each(function() {
var t = $(this);
t.html(escapeNbsp(t.html()))
var text = unEscapeNbsp(t.text());
t.contents().filter(function() { return this.nodeType == Node.TEXT_NODE; }).remove()
t.contents().filter(function() { return this.nodeName == "SPAN"; }).remove()
t.append("<pre></pre>");
t.find("pre").text(text);
var commentButton = t.find("b.add-line-comment:first").detach();
t.wrapInner("<pre class='highlight'></pre>");
commentButton.prependTo(t)
})
$(".blob-code pre").addClass("highlight");
$.SyntaxHighlighter.init({lineNumbers: false});
}
applySyntaxHighlighter()
Expand Down
2 changes: 1 addition & 1 deletion vendor/styles/theme-balupton.css
Expand Up @@ -2,7 +2,7 @@
/*font-size: 14px;*/
font-style: normal;
font-weight: normal;
line-height: 15px;
/*line-height: 15px;*/
}
.prettyprint.theme-balupton .com {
color: #008200; /* balupton green */
Expand Down

0 comments on commit 0e6e7a8

Please sign in to comment.