thephpleague / html-to-markdown

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

Add 2 x new line after converting <pre> tags #144

Closed johnsvenn closed 6 years ago

johnsvenn commented 6 years ago

Thanks for this incredibly useful code.

I've been converting lots of HTML with code snippets and come across the following: All the other block level elements apart from <pre> are followed by \n\n when they are converted.

This is inconsistent and it also seems that the resulting markdown doesn't get converted back to HTML consistently in different parsers.

Therefore when a multiline <pre> or <pre><code> is converted to ``` I've added \n\n afterwards.

Cheers

nlisgo commented 6 years ago

This needs a rebase

johnsvenn commented 6 years ago

Sure, I'll have a look. Part of it is identical to #148 anyway. Cheers

colinodell commented 6 years ago

Due to merge conflicts I manually implemented these changes via 4cc7a99 (with full credit to @johnsvenn). Thanks so much for the contribution!

johnsvenn commented 6 years ago

@colinodell Thank you, that's very kind. Sorry I didn't get round to sorting it myself.