Skip to content


Blog should do Syntax Highlighting on specific blocks #193

robyurkowski opened this Issue · 3 comments

4 participants


If we want to increase adoption amongst programmers (our biggest evangelists), it would make sense to have an in-box solution to do some syntax highlighting in the blog module.

@simi suggested using something like this:


In our blog, I monkey patched it to pick up this convention:


in the text and re-format it into a < script /> include of the gist... (the URLs follow the same pattern with the ID.js)

<%= @blog_post.gsub(/\[gist:(\d*)\]/,"<script src='\1.js'></script>") %>

Would that work? Obviously we could make it more sophisticated

Otherwise, we could try to go the github way of surrounding in ```

def highlight(blog_post_body)
  to_highlight = blog_post_body.match() #=> some regex match for ```#{formatter}\n<code>\n```
  to_highlight.formatter #=> :ruby

I was just pointed at this client-side highlighter today:

Refinery member

Stale! If anyone wants to pull request please do

@parndt parndt closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.