Commit ad8bb7f9 authored by Ondřej Borýsek's avatar Ondřej Borýsek
Browse files

Only remove top level br tags

parent d6b1585d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -214,7 +214,7 @@ class MdAndHTMLConvertor:
        #    br.decompose()

        # PwnDoc doesn't allow <br> as a top level tag. Replace it with <p><br></p>
        children = bs.findChildren("br")
        children = bs.find_all("br", recursive=False)
        for br_child in children:
            sup = bs.new_tag('p').contents = bs.new_tag("br")
            br_child.insert_after(sup)  # todo: optimize this - together with the call above it takes > 60% of the time