-
I'm using Pandoc to convert HTML to plain text in order to render HTML emails in aerc. Their recommended command line is: pandoc -f html -t plain This works well for simple emails, though many senders use deeply-nested tables for layout, and each table is rendered as an unnecessary border around the content. One of the more extreme examplesThis is a series of
Can I get Pandoc to render the table layout but without the borders? I can see there are extensions for different types of table rendering, though I've tried various combinations of enabling/disabling those on the I've also had a quick scan through the variables and writer options but can't see anything obvious to help here. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
The table extensions you have linked are for pandoc's own Markdown flavour, and disabling them shouldn't have any effect when converting from Regarding your issue, I'm not aware of any command line options that might help you here, however one thing you could do is write a Lua filter which 'promotes' the table contents to top-level blocks. If you provide an example HTML file someone may be able to help. |
Beta Was this translation helpful? Give feedback.
I wrote a filter as well, you can find it here. It is a lot less aggressive than John's filter and simply replaces tables that only contain another table with their contents, thereby preserving layout. Consequently, if one of your emails actually contains a legitimate table, it will still render properly. The filter also flattens Divs, because your email example contained a case where a Table contained a Div (which in turn contained a Table), thereby circumventing my flattening logic.