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