FIX: skip <br> inside <p> if next character is \n

This commit is contained in:
Vinoth Kannan
2019-04-14 14:44:54 +05:30
parent a423e9b14a
commit 87b53e170b
3 changed files with 6 additions and 1 deletions

View File

@ -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