Added support for inline TOCs with RDiscount

This commit is contained in:
Michishige Kaito 2011-05-15 20:05:22 +01:00 committed by Tom Preston-Werner
parent e29490c1c6
commit f5b2acf8cd
1 changed files with 6 additions and 1 deletions

View File

@ -117,7 +117,12 @@ module Jekyll
}).to_html
end
when 'rdiscount'
RDiscount.new(content, *@rdiscount_extensions).to_html
rd = RDiscount.new(content, *@rdiscount_extensions)
html = rd.to_html
if rd.generate_toc and html.include? @config['rdiscount']['toc_token']
html.gsub! @config['rdiscount']['toc_token'], rd.toc_content
end
html
when 'maruku'
Maruku.new(content).to_html
end