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

Line breaks in a paragraph #527

Open
oskla129 opened this issue Nov 23, 2021 · 4 comments
Open

Line breaks in a paragraph #527

oskla129 opened this issue Nov 23, 2021 · 4 comments
Milestone

Comments

@oskla129
Copy link

In-pragraph-line-breaks are often done using two space characters at the end of the line in Markdown.
The following line of code removes trailing whitespaces preventing the line break.

text_value = '\n'.join([s.rstrip() for s in text_value.split('\n')])

Is this a bug or by design?

@jacebrowning
Copy link
Member

In-pragraph-line-breaks are often done using two space characters at the end of the line in Markdown.

Unless I'm misunderstanding, leading and trailing whitespace is ignored: https://spec.commonmark.org/0.30/#paragraphs

I think that line was added to replicate the way many editors are configured to remove trailing whitespace.

@oskla129
Copy link
Author

It seems to ba called hard line breaks.
https://spec.commonmark.org/0.30/#hard-line-breaks

I can see that removing trailing whitespace make sense in a lot of places but for markdown it creates a problem.

@jacebrowning
Copy link
Member

Thanks for pointing me to the right place in the spec! I guess we don't support that. Does using a backslash work?

@oskla129
Copy link
Author

Backslash does not work when rendering to .html.
It seems to be because the python-markdown library does not support backslash.

@neerdoc neerdoc added the bug label Mar 9, 2022
@neerdoc neerdoc added this to the v2.4 milestone Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants