pqzx / html2docx

Convert html to docx
MIT License
69 stars 49 forks source link

[bug] tables containing a <td> whose first child is <br> results in a crash #66

Closed ptkinvent closed 5 months ago

ptkinvent commented 5 months ago

note that <br> elsewhere within the table works fine. the crash only seems to occur when it's the first child of a <td> element.

steps to replicate:

from docx import Document
from htmldocx import HtmlToDocx

document = Document()
new_parser = HtmlToDocx()

html = '<table><tr><td><br>testing</td></tr></table>'
new_parser.add_html_to_document(html, document)
ptkinvent commented 5 months ago

sorry, just realized this is a duplicate of #37, closing.