Open toshism opened 8 years ago
I shall get on it as soon as I can.
So, the way I've implemented this right now is as a post processing option. Once the MD is generated, the tables in it are beautified. Right now I have no idea how to do this recursively, so I cannot implement anything to solve this. If something does pop into my mind, I'll put it in there.
I've done some digging around. https://github.com/vmg/redcarpet/issues/394 explains why nested tables are not a good idea in MD. I'll be fixing the index error but won't be adding extra support for nested tables in any way.
That's fair. Thanks for looking in to it. How do you plan on handling nested tables? I would like to use html2text in my mailcap file to convert html emails so I obviously don't have control over the html they'll be processing, but if it could at least handle them gracefully in some way that would be great.
Markdown tables end up being ambiguous if simple markdown is used. To avoid that I'm thinking of something along the lines of:
A | B
---|------
...|[C | D]
...|---|---
...|x | y
...|x | y
...|___|___
z | q
z | q
@theSage21 That's really good, I agree with the approach,
When using --pad-tables option, if the html contains a nested table, html2text throws an IndexError.
html2text --version
html2text 2016.9.19
python --version
Python 2.7.12