#7960 Add support for Markdown footnote syntax in Mobile view
Splitting stripdown and markdownify options, because the footnote option seems to let the Redcarpet::Render::StripDown function crash
This commit is contained in:
parent
122e12a068
commit
c71caa5cb8
1 changed files with 26 additions and 17 deletions
|
|
@ -50,7 +50,7 @@ module Diaspora
|
||||||
end
|
end
|
||||||
|
|
||||||
def strip_markdown
|
def strip_markdown
|
||||||
renderer = Redcarpet::Markdown.new Redcarpet::Render::StripDown, options[:markdown_options]
|
renderer = Redcarpet::Markdown.new Redcarpet::Render::StripDown, options[:stripdown_options]
|
||||||
@message = renderer.render(message).strip
|
@message = renderer.render(message).strip
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -105,26 +105,35 @@ module Diaspora
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
DEFAULTS = {mentioned_people: [],
|
DEFAULTS = {mentioned_people: [],
|
||||||
link_all_mentions: false,
|
link_all_mentions: false,
|
||||||
disable_hovercards: false,
|
disable_hovercards: false,
|
||||||
truncate: false,
|
truncate: false,
|
||||||
append: nil,
|
append: nil,
|
||||||
append_after_truncate: nil,
|
append_after_truncate: nil,
|
||||||
squish: false,
|
squish: false,
|
||||||
escape: true,
|
escape: true,
|
||||||
escape_tags: false,
|
escape_tags: false,
|
||||||
markdown_options: {
|
stripdown_options: {
|
||||||
autolink: true,
|
autolink: true,
|
||||||
fenced_code_blocks: true,
|
fenced_code_blocks: true,
|
||||||
space_after_headers: true,
|
space_after_headers: true,
|
||||||
strikethrough: true,
|
strikethrough: true,
|
||||||
tables: true,
|
tables: true,
|
||||||
no_intra_emphasis: true,
|
no_intra_emphasis: true
|
||||||
|
},
|
||||||
|
markdown_options: {
|
||||||
|
autolink: true,
|
||||||
|
fenced_code_blocks: true,
|
||||||
|
space_after_headers: true,
|
||||||
|
strikethrough: true,
|
||||||
|
footnotes: true,
|
||||||
|
tables: true,
|
||||||
|
no_intra_emphasis: true
|
||||||
},
|
},
|
||||||
markdown_render_options: {
|
markdown_render_options: {
|
||||||
filter_html: true,
|
filter_html: true,
|
||||||
hard_wrap: true,
|
hard_wrap: true,
|
||||||
safe_links_only: true
|
safe_links_only: true
|
||||||
}}.freeze
|
}}.freeze
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue