-
Notifications
You must be signed in to change notification settings - Fork 179
Description
Describe the bug
When EditPlugin is enabled, <pre> tags get broken after pressing Enter key within them
To Reproduce
Steps to reproduce the behavior:
- Go to this sandbox
- Set carret in the text starting with
But pressing Enter anywhere.... - Press enter
- All line breaks are removed
Problem is that rooster encapsulates <pre> content in a <div style="white-space: normal;"> which, AFAIK, is not valid HTML, and overrides the white-space CSS prop of the <pre> tag.
If it was generating a white-space: pre-line; instead, HTML would still not be valid but rendering would work.
If you disable the EditPlugin() the issue stops because it does not reformats anything.
Also, if you replace \r with <br> in the original content there's no issue but that's not valid HTML if I'm not mistaken.
Expected behavior
Rendering of <pre> content should not be broken when editing its content.
Additional context
Tested with rooster 9.29.3, 9.30.0, 9.34.0 and 9.35.0, the issue exists on all of these version so it might have existed for a long time.