Permalink
Browse files

Turn github highlighted code blocks into normal markdown code blocks

  • Loading branch information...
1 parent ad8d8b5 commit 48bc1a4f5a0e40492d7d9b03b0b2dd552cb1ca6a @devongovett committed Apr 14, 2014
Showing with 5 additions and 0 deletions.
  1. +5 −0 docs/generate_website.coffee
@@ -81,6 +81,11 @@ generateImages = (tree) ->
pages = []
for file in files
content = fs.readFileSync file, 'utf8'
+
+ # turn github highlighted code blocks into normal markdown code blocks
+ content = content.replace /^```coffeescript\n((:?.|\n)*?)\n```/mg, (m, $1) ->
+ ' ' + $1.split('\n').join('\n ')
+
tree = markdown.parse(content)
headers = extractHeaders(tree)
generateImages(tree)

0 comments on commit 48bc1a4

Please sign in to comment.