mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
When inserting a line break in a contenteditable with preformatted white-space (pre, pre-line, pre-wrap), insert a newline character (\n) instead of a <br> element. Use <br> only for padding at end of line to ensure the cursor can be placed on the new line.
11 lines
272 B
Plaintext
11 lines
272 B
Plaintext
Before: "foobar"
|
|
After: "foo<br>bar"
|
|
Before: "<p style="white-space: pre">foobar</p>"
|
|
After: "<p style="white-space: pre">foo
|
|
bar</p>"
|
|
Before: "<p style="white-space: pre">foobar</p>"
|
|
After: "<p style="white-space: pre">foobar
|
|
<br></p>"
|
|
Before: "foo"
|
|
After: "foo<br><br>"
|