Alir3z4 / html2text

Convert HTML to Markdown-formatted text.
alir3z4.github.io/html2text/
GNU General Public License v3.0
1.76k stars 270 forks source link

Table padding crash on empty tables #320

Closed cgianlu closed 3 years ago

cgianlu commented 4 years ago

reformat_table function raise an exception in case of empty tables (i.e. \<table>\<\/table>).

In fact in this case the list passed as parameter (lines) is empty so the following statement is wrong (lines[0] does not exist!)

              max_width = [len(x.rstrip()) + right_margin for x in lines[0].split("|")]
mpodolsk commented 3 years ago

any plans to patch this issue, looks simple enough?

mpodolsk commented 3 years ago

the issue is also present when the does not have corresponding . closing the is optional. this issue is present because whole table is treated as one line and the is in that line

I will workup a fork.

Alir3z4 commented 3 years ago

Fixed in https://github.com/Alir3z4/html2text/pull/361

mpodolsk commented 3 years ago

when this will be tagged and published as a release ? looking at repo tags there are some tags missing comparing to change-log notes. latest points to 2019