-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Newlines in WYSIWYG are not correctly converted to markdown #1347
Comments
I think unfortunately, fixing this might not be backwards compatible :/ as some user might actually depend on this functionality. That |
I noticed goldmark, which is our Go renderer on backend, has option |
https://spec.commonmark.org/0.29/#hard-line-breaks I see "A renderer may also provide an option to render soft line breaks as hard line breaks", but I don't see if you provide such an option? (If you do, it's on by default :D ) |
@karelbilek I think the problem you are talking about is because the soft brake works like a hard brake. First of all, the Editor follows the CommonMark specification, but because of the compatibility between Markdown and WYSIWYG editors, newline is treated as a hard break. This is the Editor's spec. In the Markdown's preview, the rendering of soft breaks and hard breaks can be handled using |
What I think is even worse: If you break the line like this in Markdown mode:
... and then switch to WYSIWYG, it changes the actual Markdown to:
... removing the line break (and the spaces) completely! This is a huge problem, because if you load existing Markdown content (that was not created in the editor in the first place) that uses the two trailing spaces before the line break, the editor completely destroys those line breaks! |
Describe the bug
When newline is in WYSIWYG mode inside a paragraph, it's not converted correctly to Markdown
To Reproduce
(note: this will be a bit hard to read due to Markdown's use of whitespace)
Steps to reproduce the behavior:
That is -
foo<space>bar<newline>foo<space>bar
Expected behavior
See:
Actual behavior
See:
Note that this is not actually visible, as you cannot see the whitespaces, but it differs on what is actually there.
Desktop (please complete the following information):
Replicable everywhere
Additional context
Newline in Markdown inside a paragraph should NOT trigger a newline. So,
foo<space>bar<newline>foo<space>bar
in Markdown should render asfoo<space>bar<space>foo<space>bar
.This editor does not follow this.
So, when user enters, into WYSIWYG
(without the spaces)
and then, we save the Markdown from the editor and use a different, but CommonMark compliant, parser and renderer, it gets rendered incorrectly.
The text was updated successfully, but these errors were encountered: