Allow setting of Kramdown smart_quotes. Fixes #482.
This commit is contained in:
parent
4499df8033
commit
e29490c1c6
|
|
@ -10,6 +10,7 @@
|
||||||
* URL escape category names in URL generation (#360)
|
* URL escape category names in URL generation (#360)
|
||||||
* Fix error with limit_posts (#442)
|
* Fix error with limit_posts (#442)
|
||||||
* Properly select dotfile during directory scan (#363, #431, #377)
|
* Properly select dotfile during directory scan (#363, #431, #377)
|
||||||
|
* Allow setting of Kramdown smart_quotes (#482)
|
||||||
|
|
||||||
== 0.11.2 / 2011-12-27
|
== 0.11.2 / 2011-12-27
|
||||||
* Bug Fixes
|
* Bug Fixes
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ Gem::Specification.new do |s|
|
||||||
s.add_runtime_dependency('classifier', "~> 1.3")
|
s.add_runtime_dependency('classifier', "~> 1.3")
|
||||||
s.add_runtime_dependency('directory_watcher', "~> 1.1")
|
s.add_runtime_dependency('directory_watcher', "~> 1.1")
|
||||||
s.add_runtime_dependency('maruku', "~> 0.5")
|
s.add_runtime_dependency('maruku', "~> 0.5")
|
||||||
s.add_runtime_dependency('kramdown', "~> 0.13")
|
s.add_runtime_dependency('kramdown', "~> 0.13.4")
|
||||||
s.add_runtime_dependency('albino', "~> 1.3")
|
s.add_runtime_dependency('albino', "~> 1.3")
|
||||||
|
|
||||||
s.add_development_dependency('rake', "~> 0.9")
|
s.add_development_dependency('rake', "~> 0.9")
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,7 @@ module Jekyll
|
||||||
'footnote_nr' => 1,
|
'footnote_nr' => 1,
|
||||||
'entity_output' => 'as_char',
|
'entity_output' => 'as_char',
|
||||||
'toc_levels' => '1..6',
|
'toc_levels' => '1..6',
|
||||||
|
'smart_quotes' => 'lsquo,rsquo,ldquo,rdquo',
|
||||||
'use_coderay' => false,
|
'use_coderay' => false,
|
||||||
|
|
||||||
'coderay' => {
|
'coderay' => {
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,7 @@ module Jekyll
|
||||||
:footnote_nr => @config['kramdown']['footnote_nr'],
|
:footnote_nr => @config['kramdown']['footnote_nr'],
|
||||||
:entity_output => @config['kramdown']['entity_output'],
|
:entity_output => @config['kramdown']['entity_output'],
|
||||||
:toc_levels => @config['kramdown']['toc_levels'],
|
:toc_levels => @config['kramdown']['toc_levels'],
|
||||||
|
:smart_quotes => @config['kramdown']['smart_quotes'],
|
||||||
|
|
||||||
:coderay_wrap => @config['kramdown']['coderay']['coderay_wrap'],
|
:coderay_wrap => @config['kramdown']['coderay']['coderay_wrap'],
|
||||||
:coderay_line_numbers => @config['kramdown']['coderay']['coderay_line_numbers'],
|
:coderay_line_numbers => @config['kramdown']['coderay']['coderay_line_numbers'],
|
||||||
|
|
@ -111,7 +112,8 @@ module Jekyll
|
||||||
:auto_ids => @config['kramdown']['auto_ids'],
|
:auto_ids => @config['kramdown']['auto_ids'],
|
||||||
:footnote_nr => @config['kramdown']['footnote_nr'],
|
:footnote_nr => @config['kramdown']['footnote_nr'],
|
||||||
:entity_output => @config['kramdown']['entity_output'],
|
:entity_output => @config['kramdown']['entity_output'],
|
||||||
:toc_levels => @config['kramdown']['toc_levels']
|
:toc_levels => @config['kramdown']['toc_levels'],
|
||||||
|
:smart_quotes => @config['kramdown']['smart_quotes']
|
||||||
}).to_html
|
}).to_html
|
||||||
end
|
end
|
||||||
when 'rdiscount'
|
when 'rdiscount'
|
||||||
|
|
|
||||||
|
|
@ -3,21 +3,31 @@ require 'helper'
|
||||||
class TestKramdown < Test::Unit::TestCase
|
class TestKramdown < Test::Unit::TestCase
|
||||||
context "kramdown" do
|
context "kramdown" do
|
||||||
setup do
|
setup do
|
||||||
config = {
|
@config = {
|
||||||
'markdown' => 'kramdown',
|
'markdown' => 'kramdown',
|
||||||
'kramdown' => {
|
'kramdown' => {
|
||||||
'auto_ids' => false,
|
'auto_ids' => false,
|
||||||
'footnote_nr' => 1,
|
'footnote_nr' => 1,
|
||||||
'entity_output' => 'as_char',
|
'entity_output' => 'as_char',
|
||||||
'toc_levels' => '1..6'
|
'toc_levels' => '1..6',
|
||||||
|
'smart_quotes' => 'lsquo,rsquo,ldquo,rdquo'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@markdown = MarkdownConverter.new config
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# http://kramdown.rubyforge.org/converter/html.html#options
|
# http://kramdown.rubyforge.org/converter/html.html#options
|
||||||
should "pass kramdown options" do
|
should "pass kramdown options" do
|
||||||
assert_equal "<h1>Some Header</h1>", @markdown.convert('# Some Header #').strip
|
markdown = MarkdownConverter.new(@config)
|
||||||
|
assert_equal "<h1>Some Header</h1>", markdown.convert('# Some Header #').strip
|
||||||
|
end
|
||||||
|
|
||||||
|
should "convert quotes to smart quotes" do
|
||||||
|
markdown = MarkdownConverter.new(@config)
|
||||||
|
assert_equal "<p>“Pit’hy”</p>", markdown.convert(%{"Pit'hy"}).strip
|
||||||
|
|
||||||
|
override = { 'kramdown' => { 'smart_quotes' => 'lsaquo,rsaquo,laquo,raquo' } }
|
||||||
|
markdown = MarkdownConverter.new(@config.deep_merge(override))
|
||||||
|
assert_equal "<p>«Pit›hy»</p>", markdown.convert(%{"Pit'hy"}).strip
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ class TestTags < Test::Unit::TestCase
|
||||||
|
|
||||||
def create_post(content, override = {}, converter_class = Jekyll::MarkdownConverter)
|
def create_post(content, override = {}, converter_class = Jekyll::MarkdownConverter)
|
||||||
stub(Jekyll).configuration do
|
stub(Jekyll).configuration do
|
||||||
Jekyll::DEFAULTS.merge({'pygments' => true}).merge(override)
|
Jekyll::DEFAULTS.deep_merge({'pygments' => true}).deep_merge(override)
|
||||||
end
|
end
|
||||||
site = Site.new(Jekyll.configuration)
|
site = Site.new(Jekyll.configuration)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue