|
|
@ -335,15 +335,19 @@ module ApplicationHelper
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def to_markdown(text)
|
|
|
|
def to_markdown(text)
|
|
|
|
nil if text.blank?
|
|
|
|
return nil if text.blank?
|
|
|
|
html_render_options = {
|
|
|
|
options = {
|
|
|
|
fenced_code_blocks: true,
|
|
|
|
:autolink => true,
|
|
|
|
tables: true,
|
|
|
|
:no_intra_emphasis => true,
|
|
|
|
autolink: true
|
|
|
|
:fenced_code_blocks => true,
|
|
|
|
|
|
|
|
:lax_html_blocks => true,
|
|
|
|
|
|
|
|
:strikethrough => true,
|
|
|
|
|
|
|
|
:superscript => true,
|
|
|
|
|
|
|
|
:tables => true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
markdown = Redcarpet::Markdown.new(html_render_options)
|
|
|
|
markdown = Redcarpet::Markdown.new(options)
|
|
|
|
raw markdown.render(h(text)).html_safe
|
|
|
|
markdown.render(h(text)).html_safe
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|