EvitanRelta/markgh

Linebreak after block element doesn't render properly

Closed this issue · 1 comments

If theres a line break after a block element (eg. paragraph, or header), Github markdown won't render the linebreak
(though Github issues renders it slightly differently).


                  Current MarkGH generated markdown                  
Code Rendered on Github
paragraph
<br>

## HEADER

paragraph

HEADER

Expected

paragraph

HEADER

Possible Fixes
paragraph
<br>&ZeroWidthSpace;

## HEADER

paragraph

HEADER

paragraph
<br><br>

## HEADER

paragraph

HEADER

paragraph<br><br>

## HEADER
(same as above, but also renders the same in Github Issues)

Proposed fix

The below conversion might be more inclusive (as it renders the same in Github Issues):

paragraph<br><br>

## HEADER


But this one looks cleaner. And since Github Issue's renderer is different, we probably don't need to take it into account?

paragraph
<br><br>

## HEADER

Another benefit of putting the <br><br> on a new line:
it transitions smoother (ie. minimal conversion changes) when u later fill that line with text:

better transition


compared to <br><br> on the same line:

shittier transition