diff --git a/ChangeLog.rst b/ChangeLog.rst index 3c642f9..72aefde 100644 --- a/ChangeLog.rst +++ b/ChangeLog.rst @@ -11,7 +11,7 @@ UNRELEASED * Don't wrap tables by default and add a ``--wrap-tables`` config option * Fix #320 padding empty tables and tables with no tags. * Add ``ignore_mailto_links`` config option to ignore ``mailto:`` style links. - +* Feature #198: Ignore ``

`` and ``

`` tags inside table rows. 2020.1.16 ========= diff --git a/html2text/__init__.py b/html2text/__init__.py index c59ae16..47fcb95 100644 --- a/html2text/__init__.py +++ b/html2text/__init__.py @@ -368,6 +368,8 @@ def handle_tag( self.soft_br() elif self.astack: pass + elif self.split_next_td: + pass else: self.p() diff --git a/test/no_p_in_table.html b/test/no_p_in_table.html new file mode 100644 index 0000000..73c1bb8 --- /dev/null +++ b/test/no_p_in_table.html @@ -0,0 +1,12 @@ + + +

This is a test document

With some text, code, bolds and italics.

This is second header

Displaynone text

+ + + + + + +
Header 1 Header 2 Header 3

Content 1

2

200 Image!

Content 1 longer

Content 2

blah

Content

Content 2

blah

t

Content 2

blah blah blah

+ + diff --git a/test/no_p_in_table.md b/test/no_p_in_table.md new file mode 100644 index 0000000..f22449e --- /dev/null +++ b/test/no_p_in_table.md @@ -0,0 +1,15 @@ +# This is a test document + +With some text, `code`, **bolds** and _italics_. + +## This is second header + +Displaynone text + +Header 1 | Header 2 | Header 3 +---|---|--- +Content 1 | 2 | ![200](http://lorempixel.com/200/200) Image! +Content 1 longer | Content 2 | blah +Content | Content 2 | blah +t | Content 2 | blah blah blah +