Closed silverwind closed 9 months ago
Don't ignore issue template
Yeah it's not a valid issue because GoldMark rendering matches the spec, but GitHub diverges. I should have made a discussion. Still, it might a behaviour to consider for the GFM rendering, assuming the goal is to render like GitHub.
Related CommonMark issue: https://github.com/commonmark/commonmark-spec/issues/501
Goldmark renders a
\n
at the end of<pre><code>
blocks but this newline is undesirable in some cases. For example:will render
On GitHub, the same source renders without this newline (ignore the different wrapping tags):
While the presence or absence of this newline makes no difference in the visual HTML, it does make a difference when JavaScript reads the content of the element, for example for the purpose of copying to clipboard.
How about adding a parser option to ignore/remove the final newline? Or is stripping the newline possible already somehow?