Skip to content

Commit

Permalink
borked the highlight so I removed
Browse files Browse the repository at this point in the history
  • Loading branch information
brianleroux committed Jul 15, 2010
1 parent cfd85f5 commit 2878407
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions node-code-blog/post.js
Expand Up @@ -11,12 +11,6 @@ var Post = function(filename){
};

Post.all = function(files) {
files = files.filter(function (f) {
if (0 === f.indexOf('.')) {
return false;
}
return true;
});
return files.map(function(f) {
return new Post(f);
});
Expand Down Expand Up @@ -101,17 +95,15 @@ Post.prototype = {
// read in the post text
var p = path.normalize(path.join(__dirname, "..", "posts", this.filename))
, t = fs.readFileSync(p).toString();

// markdown to html
t = md2html(t);


// replace the raw code blocks with prettyfied html
t = t.replace(/<code>[^<]+<\/code>/g, function(code) {
return "<code>" + prettyfy(code.match(/<code>([\s\S]+)<\/code>/)[1]) + "</code>";
return "<pre><code>" + prettyfy(code.match(/<code>([\s\S]+)<\/code>/)[1]) + "</code></pre>";
});

return t;
// return markdown to html
return md2html(t);
}
};

exports.Post = Post;
exports.Post = Post;

0 comments on commit 2878407

Please sign in to comment.