diff --git a/src/Html2Text.php b/src/Html2Text.php index 5153cef..c9b3b4a 100644 --- a/src/Html2Text.php +++ b/src/Html2Text.php @@ -285,6 +285,7 @@ static function iterateOverNode($node, $prevName = null, $in_pre = false, $is_of case "ol": case "ul": case "pre": + case "table": // add two newlines $output = "\n\n"; break; @@ -396,6 +397,7 @@ static function iterateOverNode($node, $prevName = null, $in_pre = false, $is_of case "h5": case "h6": case "pre": + case "table": case "p": // add two lines $output .= "\n\n"; diff --git a/tests/full_email.txt b/tests/full_email.txt index 1b464c5..8919aa8 100644 --- a/tests/full_email.txt +++ b/tests/full_email.txt @@ -19,6 +19,7 @@ You're currently finding about per day [Number of cats found] + --------------------------------------------------------------- Your last cat was found two days ago. diff --git a/tests/table.html b/tests/table.html index b4b3cf0..04baffe 100644 --- a/tests/table.html +++ b/tests/table.html @@ -48,6 +48,6 @@

Hello, World!

- +
Text below
\ No newline at end of file diff --git a/tests/table.txt b/tests/table.txt index f03bace..29f94ed 100644 --- a/tests/table.txt +++ b/tests/table.txt @@ -4,4 +4,6 @@ Col A Col B Data A1 Data B1 Data A2 Data B2 Data A3 Data B4 -Total A Total B \ No newline at end of file +Total A Total B + +Text below \ No newline at end of file