diff --git a/lib/jekyll/converters/markdown.rb b/lib/jekyll/converters/markdown.rb index 78e313d9..32820ef4 100644 --- a/lib/jekyll/converters/markdown.rb +++ b/lib/jekyll/converters/markdown.rb @@ -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