Closed MrPetovan closed 6 years ago
Thanks for reporting this! I have modified the library to always use multi-line blocks if a language is present. I'll tag bugfix release 4.7.1 once the Travis tests pass.
Thanks, I was about to submit a much larger patch taking into account the parent element of the <code>
tag, which is the deciding factor over whether it should be a multiline code block or not. <code>
is a preformatted inline tag and as such in HTML, newlines aren't preserved unlike with the <pre>
.
Ah okay, well if you'd like to submit that I'd gladly accept it over my quick fix :) I'll hold off on releasing then.
By all means, release away!
Done! https://github.com/thephpleague/html-to-markdown/releases/tag/4.8.0 Thanks again for your help!
Per CommonMark spec (https://spec.commonmark.org/0.28/#fenced-code-blocks), this Markdown code
But fed into the HTML-to-Markdown convert, this HTML gives the following Markdown output:
I understand this is intentional per https://github.com/thephpleague/html-to-markdown/pull/102 but this isn't expected.
Please revert this change concerning the single-line code blocks to fix this inconsistency with CommonMark.
We're using the HTML-to-Markdown converter over at https://github.com/friendica/friendica to communicate with Diaspora and we expect a reversible conversion between CommonMark and HTML.