compatible with RedCarpet 2.0+

This commit is contained in:
xdite
2011-12-01 19:26:14 +08:00
parent 101f43947f
commit 7924e8c9a9
+22 -9
View File
@@ -447,15 +447,28 @@ module Gollum
data = extract_code(data)
data = extract_tags(data)
flags = [
:autolink,
:fenced_code,
:tables,
:strikethrough,
:lax_htmlblock,
:no_intraemphasis
]
data = Redcarpet.new(data, *flags).to_html
if Gem::Version.new(Redcarpet::VERSION) > Gem::Version.new("1.17.2")
html_renderer = Redcarpet::Render::HTML.new({
:autolink => true,
:fenced_code_blocks => true,
:tables => true,
:strikethrough => true,
:lax_htmlblock => true,
:no_intraemphasis => true
})
markdown = Redcarpet::Markdown.new(html_renderer)
data = markdown.render(data)
else
flags = [
:autolink,
:fenced_code,
:tables,
:strikethrough,
:lax_htmlblock,
:no_intraemphasis
]
data = Redcarpet.new(data, *flags).to_html
end
data = process_tags(data)
data = process_code(data)