Repository navigation
Question: An extra blank line at the end of the code block #685
|
I use The html generated during the process is as follows: The markdown generated at the end is as follows: I have an extra blank line at the end of a code block. |
Replies: 1 comment 1 reply
|
Good question! The CommonMark spec says:
Because There is no built-in way to remove that trailing newline character, but you could implement a custom event listener that listens for the |
Good question! The CommonMark spec says:
Because
hogehogeis followed by a newline character before the final fence, that newline gets included.There is no built-in way to remove that trailing newline character, but you could implement a custom event listener that listens for the
DocumentParsedEvent, walks the AST looking forFencedCodenotes, and then perform anrtrim()on the contents. Unfortunately, 1.x doesn't provide functionality to modify those contents, but 2.0 will! For 1.x you'd instead need to implement a custom renderer forFencedCodeobjects and strip the trailing newline that way.