I'm using Rails 3.2.11, Haml 4.0 and Redcarpet 2.2.2.
I would like to configure Haml's :markdown
filter to use Redcarpet with with_toc_data: true
. In ApplicationHelper
I tried defining:
def markdown(text)
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML.new(with_toc_data: true))
raw markdown.render(text.to_s)
end
Though content in :markdown
gets rendered, but without TOC data. How do I alter how :markdown
is parsed?