Permalink
Browse files

fix: new version of `marked` breaks highlighting

  • Loading branch information...
1 parent 7ea2503 commit 267941e1ad1d5c1696fd85001a53edaab3389597 @qiao committed May 2, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 public/javascripts/mdwatch.js
View
4 public/javascripts/mdwatch.js
@@ -34,13 +34,13 @@ var MdWatch = (function() {
// the server will respond with the colorized html,
// then replace the parent(a `pre` node) of current node with the colorized one.
$('code').each(function(idx, ele) {
- if (ele.className) {
+ if (ele.className.indexOf('lang-') !== -1) {
$.ajax({
url: '/colorize',
type: 'post',
data: {
code: $(ele).text(),
- lang: ele.className
+ lang: ele.className.slice(5)
},
success: function(data) {
$(ele).parent().replaceWith($(data));

0 comments on commit 267941e

Please sign in to comment.