-
-
Save wangzuo/3770324 to your computer and use it in GitHub Desktop.
Redcarpet (Markdown) template handler for Rails 3.1.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/redcarpet.rb | |
class ActionView::Template | |
class Redcarpet < Handler | |
include Handlers::Compilable | |
def compile template | |
::Redcarpet.new(template.source).to_html.inspect | |
end | |
end | |
register_template_handler :markdown, Redcarpet | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment