thephpleague / html-to-markdown

Convert HTML to Markdown with PHP
MIT License
1.77k stars 205 forks source link

<p> not converted to new line when it follows a</table> tag #165

Closed dac514 closed 5 years ago

dac514 commented 5 years ago

When converting:

<p>sadasd erwerwer 1</p>
<p>asddsa erwerwer 2</p>
<table style="border-collapse: collapse; width: 100%;" border="1">
<tbody>
<tr>
<td style="width: 33.3333%;">d</td>
<td style="width: 33.3333%;">d</td>
<td style="width: 33.3333%;">d</td>
</tr>
<tr>
<td style="width: 33.3333%;">d</td>
<td style="width: 33.3333%;">d</td>
<td style="width: 33.3333%;">d</td>
</tr>
</tbody>
</table>
<p>line 4</p>
<p>line 5</p>

Expected:

sadasd erwerwer 1

asddsa erwerwer 2

<table border="1" style="border-collapse: collapse; width: 100%;"><tbody><tr><td style="width: 33.3333%;">d</td><td style="width: 33.3333%;">d</td><td style="width: 33.3333%;">d</td></tr><tr><td style="width: 33.3333%;">d</td><td style="width: 33.3333%;">d</td><td style="width: 33.3333%;">d</td></tr></tbody></table>

line 4

line 5

Actual:

sadasd erwerwer 1

asddsa erwerwer 2

<table border="1" style="border-collapse: collapse; width: 100%;"><tbody><tr><td style="width: 33.3333%;">d</td><td style="width: 33.3333%;">d</td><td style="width: 33.3333%;">d</td></tr><tr><td style="width: 33.3333%;">d</td><td style="width: 33.3333%;">d</td><td style="width: 33.3333%;">d</td></tr></tbody></table>line 4

line 5

The problem is : </table>line 4 near the end.

When I parse using PHP Parsedown everything after </table> gets truncated.

colinodell commented 5 years ago

Fixed via #166