Cleanup for RDiscount TOC support. Closes #333.
This commit is contained in:
parent
6471ebf0ef
commit
8a0fbf02f5
|
@ -5,6 +5,7 @@
|
|||
* Allow setting of RedCloth options (#284)
|
||||
* Add post_url Liquid tag for internal post linking (#369)
|
||||
* Allow multiple plugin dirs to be specified (#438)
|
||||
* Inline TOC token support for RDiscount (#333)
|
||||
* Bug Fixes
|
||||
* Allow some special characters in highlight names
|
||||
* URL escape category names in URL generation (#360)
|
||||
|
|
|
@ -119,8 +119,8 @@ module Jekyll
|
|||
when 'rdiscount'
|
||||
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
|
||||
if rd.generate_toc and html.include?(@config['rdiscount']['toc_token'])
|
||||
html.gsub!(@config['rdiscount']['toc_token'], rd.toc_content)
|
||||
end
|
||||
html
|
||||
when 'maruku'
|
||||
|
|
|
@ -5,8 +5,8 @@ class TestRdiscount < Test::Unit::TestCase
|
|||
context "rdiscount" do
|
||||
setup do
|
||||
config = {
|
||||
'rdiscount' => { 'extensions' => ['smart', 'generate_toc'], 'toc_token' => '{:toc}' },
|
||||
'markdown' => 'rdiscount'
|
||||
'markdown' => 'rdiscount',
|
||||
'rdiscount' => { 'extensions' => ['smart', 'generate_toc'], 'toc_token' => '{:toc}' }
|
||||
}
|
||||
@markdown = MarkdownConverter.new config
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue