Notice they changed to sets of hashes for options. One hash of options for the Redcarpet::Render::HTML.new(options hash here)
and the second options hash for the Redcarpet::Markdown.new(renderer(this is where the renderer goes), markdown hash here). To understand, here are both without removing options into two variables.
ruby
defmarkdown(blogtext)
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML.new({hard_wrap:true, filter_html:true}), {autolink:true, no_intra_emphasis:true})
markdown.render(blogtext).htm_safe
end
Check their github site to find out which options belongs in which options hash.
Update for anyone using RedCarpet 3.0.0
Using this RailsCast, just change the helper method to this:
Then in view just use
<%= markdown(@blog.body) %>
Notice they changed to sets of hashes for options. One hash of options for the Redcarpet::Render::HTML.new(options hash here)
and the second options hash for the Redcarpet::Markdown.new(renderer(this is where the renderer goes), markdown hash here). To understand, here are both without removing options into two variables.
Check their github site to find out which options belongs in which options hash.