Have TextileConverter pass any arguments set to true in config's redcloth section to RedCloth constructor as an array of symbols.
This means explicitly setting (for example): redcloth: hard_breaks: false lite_mode: true no_span_caps: true will cause RedCloth to be invoked thusly: RedCloth.new(content, [:lite_mode, :no_span_caps]) (Notice that hard_breaks is ignored.) This means, however, anything set to true in the redcloth section in _config.yml _will_ be passed to RedCloth. Mayhem may ensue.
This commit is contained in:
parent
bb9f1064d3
commit
8c4edb655e
|
@ -27,13 +27,18 @@ module Jekyll
|
||||||
|
|
||||||
def convert(content)
|
def convert(content)
|
||||||
setup
|
setup
|
||||||
r = RedCloth.new(content)
|
|
||||||
|
|
||||||
if !@config['redcloth'].nil? and !@config['redcloth']['hard_breaks'].nil?
|
restrictions = Array.new
|
||||||
r.hard_breaks = @config['redcloth']['hard_breaks']
|
if !@config['redcloth'].nil?
|
||||||
|
@config['redcloth'].each do |key, value|
|
||||||
|
restrictions << key.to_sym if value
|
||||||
|
end
|
||||||
|
require 'ap'
|
||||||
|
ap restrictions
|
||||||
end
|
end
|
||||||
|
|
||||||
r.to_html
|
|
||||||
|
RedCloth.new(content, restrictions).to_html
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue