mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
restore the 'incoming_email_prefer_html' site setting
This commit is contained in:
parent
304ace926e
commit
0ec15af970
4 changed files with 24 additions and 6 deletions
|
@ -188,17 +188,21 @@ module Email
|
|||
text = fix_charset(@mail)
|
||||
end
|
||||
|
||||
if text.present?
|
||||
text, elided_text = if text.present?
|
||||
text = trim_discourse_markers(text)
|
||||
text, elided = EmailReplyTrimmer.trim(text, true)
|
||||
return [text, elided]
|
||||
EmailReplyTrimmer.trim(text, true)
|
||||
end
|
||||
|
||||
if html.present?
|
||||
markdown, elided_markdown = if html.present?
|
||||
markdown = HtmlToMarkdown.new(html).to_markdown
|
||||
markdown = trim_discourse_markers(markdown)
|
||||
markdown, elided = EmailReplyTrimmer.trim(markdown, true)
|
||||
return [markdown, elided]
|
||||
EmailReplyTrimmer.trim(markdown, true)
|
||||
end
|
||||
|
||||
if text.blank? || (SiteSetting.incoming_email_prefer_html && markdown.present?)
|
||||
return [markdown, elided_markdown]
|
||||
else
|
||||
return [text, elided_text]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue