mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-29 03:53:52 +00:00
Fix local text/html toots not being sanitized
This commit is contained in:
parent
4fbce23992
commit
2332b3f146
|
@ -61,7 +61,9 @@ class Formatter
|
||||||
html = encode_and_link_urls(html, linkable_accounts, keep_html: %w(text/markdown text/html).include?(status.content_type))
|
html = encode_and_link_urls(html, linkable_accounts, keep_html: %w(text/markdown text/html).include?(status.content_type))
|
||||||
html = encode_custom_emojis(html, status.emojis, options[:autoplay]) if options[:custom_emojify]
|
html = encode_custom_emojis(html, status.emojis, options[:autoplay]) if options[:custom_emojify]
|
||||||
|
|
||||||
unless %w(text/markdown text/html).include?(status.content_type)
|
if %w(text/markdown text/html).include?(status.content_type)
|
||||||
|
html = reformat(html)
|
||||||
|
else
|
||||||
html = simple_format(html, {}, sanitize: false)
|
html = simple_format(html, {}, sanitize: false)
|
||||||
html = html.delete("\n")
|
html = html.delete("\n")
|
||||||
end
|
end
|
||||||
|
@ -70,7 +72,7 @@ class Formatter
|
||||||
end
|
end
|
||||||
|
|
||||||
def format_markdown(html)
|
def format_markdown(html)
|
||||||
html = reformat(markdown_formatter.render(html))
|
html = markdown_formatter.render(html)
|
||||||
html.delete("\r").delete("\n")
|
html.delete("\r").delete("\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue