mirror of
https://github.com/discourse/discourse.git
synced 2025-08-21 19:11:18 +08:00
FIX: Font tag resulted in wrong email trimming
This commit is contained in:
parent
37461a6398
commit
577af81e76
2 changed files with 11 additions and 4 deletions
|
@ -16,8 +16,10 @@ class HtmlToMarkdown
|
|||
end
|
||||
|
||||
# If a `<div>` is within a `<span>` that's invalid, so let's hoist the `<div>` up
|
||||
INLINE_ELEMENTS ||= %w{span font}
|
||||
BLOCK_ELEMENTS ||= %w{div p}
|
||||
def fix_span_elements(node)
|
||||
if node.name == 'span' && node.at('div')
|
||||
if (INLINE_ELEMENTS.include?(node.name) && BLOCK_ELEMENTS.any? { |e| node.at(e) })
|
||||
node.swap(node.children)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue