Skip to content

Commit f5b2acf

Browse files
Michishige Kaitomojombo
authored andcommitted
Added support for inline TOCs with RDiscount
1 parent e29490c commit f5b2acf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/jekyll/converters/markdown.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,12 @@ def convert(content)
117117
}).to_html
118118
end
119119
when 'rdiscount'
120-
RDiscount.new(content, *@rdiscount_extensions).to_html
120+
rd = RDiscount.new(content, *@rdiscount_extensions)
121+
html = rd.to_html
122+
if rd.generate_toc and html.include? @config['rdiscount']['toc_token']
123+
html.gsub! @config['rdiscount']['toc_token'], rd.toc_content
124+
end
125+
html
121126
when 'maruku'
122127
Maruku.new(content).to_html
123128
end

0 commit comments

Comments
 (0)