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

Do not delete soft lines (optionally?) #29

Closed
karelbilek opened this issue Jan 19, 2021 · 5 comments
Closed

Do not delete soft lines (optionally?) #29

karelbilek opened this issue Jan 19, 2021 · 5 comments

Comments

@karelbilek
Copy link
Collaborator

karelbilek commented Jan 19, 2021

Currently we put together newlines. That is

foo bar
baz baz

will be formatted as

foo bar baz baz

This is basically correct.

A conforming parser may render a soft line break in HTML either as a line break or as a space.

https://spec.commonmark.org/0.29/#soft-line-breaks

However, as the spec says also,

A renderer may also provide an option to render soft line breaks as hard line breaks.

I have now saw an issue in one project where those soft lines were actually interpreted as hard lines, and this option was "on by default", so these soft lines were actually important. (Related to nhn/tui.editor#1347 )

We can see goldmark for inspiration; goldmark has option WithHardLines for renderer; we can copy that directly almost.

@karelbilek
Copy link
Collaborator Author

@bwplotka
Copy link
Collaborator

bwplotka commented Aug 3, 2021

Or we could actually automatically tell what max char length should it be (:

@karelbilek
Copy link
Collaborator Author

Taking max width and breaking on that is a different thing from preserving current lines.

Both would be fine :P

I'm now kind of busy, PR welcome :D

@abhinav
Copy link
Collaborator

abhinav commented Nov 2, 2022

Looks like this is done with #36? Should this issue be closed?

@abhinav
Copy link
Collaborator

abhinav commented Nov 30, 2022

Done in #36

@abhinav abhinav closed this as completed Nov 30, 2022
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

3 participants