mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 13:31:18 +08:00
FIX: skip <br> inside <p> if next character is \n
This commit is contained in:
@ -185,6 +185,7 @@ class HtmlToMarkdown
|
||||
|
||||
def visit_br(node)
|
||||
return if node.previous_sibling.nil? && EMPHASIS.include?(node.parent.name)
|
||||
return if node.parent.name == "p" && (node.next_sibling&.text || "").start_with?("\n")
|
||||
@stack[-1].markdown << "\n"
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user