Skip to content

Instantly share code, notes, and snippets.

@behrangsa
Created December 7, 2011 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save behrangsa/1442909 to your computer and use it in GitHub Desktop.
Save behrangsa/1442909 to your computer and use it in GitHub Desktop.
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML)
code = "```ruby
1 + 1
```"
markdown.render(code)
# produces
# <p><code>ruby\n1 + 1\n</code></p>\n
# rather than
# <p><code>1 + 1\n</code></p>\n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment