denoland / deno-gfm

Server-side GitHub Flavored Markdown rendering for Deno
https://jsr.io/@deno/gfm
MIT License
226 stars 37 forks source link

Add an option for hard line breaks #98

Closed silloi closed 9 months ago

silloi commented 9 months ago

I expected this markdown text:

From fairest creatures we desire increase,
That thereby beauty’s rose might never die,
But as the riper should by time decrease,
His tender heir mught bear his memeory:

to be rendered like this (as the same as on GitHub):

From fairest creatures we desire increase,
That thereby beauty’s rose might never die,
But as the riper should by time decrease,
His tender heir mught bear his memeory:

However it is actually rendered like this:

From fairest creatures we desire increase, That thereby beauty’s rose might never die, But as the riper should by time decrease, His tender heir mught bear his memeory:

Meanwhile, I hope deno-gfm will have a rendering option for line breaks as so-called hard line breaks.

const body = render(markdown, {
  hardLineBreaks: true,
});

Thanks!