thephpleague / html-to-markdown

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

Added hard_break option for GFM line breaks (#112) #115

Closed IllyaMoskvin closed 7 years ago

IllyaMoskvin commented 7 years ago

Fixes #112. Please see that issue for more details. Adds hard_break config option. By default, it is set to false, which will cause br tags to be converted to two spaces followed by a newline character, preserving current behavior. When hard_break is set to true, those two spaces will be omitted, as per GitHub Flavored Markdown. README.md has been updated, new tests added, and everything seems to be in order.

IllyaMoskvin commented 7 years ago

Rebased the changes on the new master as of 20d2e21f10847e258a16a914b2f1dd1e82191620 to remove conflicts. When you get a chance, pretty please merge this PR! If there are any concerns, I'd be happy to discuss them further, either here or in #112.

colinodell commented 7 years ago

Sorry for the delay in getting feedback to you.

As much as I do prefer sticking to CommonMark, your argument makes sense, and I'm okay with adding a configuration option to selectively change this behavior.

Thanks so much for your contribution and detailed explanation!