Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backslash escaping removes new line #224

Closed
Destroyer opened this issue Aug 28, 2021 · 1 comment
Closed

Backslash escaping removes new line #224

Destroyer opened this issue Aug 28, 2021 · 1 comment

Comments

@Destroyer
Copy link

The following doesn't work as expected

hello
\- world

when tested on https://spec.commonmark.org/dingus/ it shows the result on one line, ommiting line break.

As element uses commonmark it has the same issue.

@jgm
Copy link
Member

jgm commented Aug 28, 2021

This has nothing to do with backslash escaping.
By default, line breaks are treated like spaces, so you can hard-wrap text.
If you want them treated as hard breaks instead, the README.md explains how to do that:

For example, to make soft breaks render as hard breaks in HTML:

var writer = new commonmark.HtmlRenderer({softbreak: "<br />"});         

@jgm jgm closed this as completed Aug 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants