Lexical version: v0.50.0+dev.esm
Steps To Reproduce
- Copy the output of this HTML from somewhere like jsfiddle
<html>
<body>
<pre>Some text here</pre> </br>
<pre >Some more text there</pre>
</body>
</html>
- Paste the clipboard in the lexical playground
- Notice that a code block with content
some text here then an empty line then another code block with content Some more text there will be added
- Delete everything from the playground so you are in a fresh state
- Now add a code block with ctrl+alt+c and ensure your cursor is inside the code block.
- Paste content from your clipboard again
- Notice that only
Some text here will be copied, the second part is lost.
The current behavior
Pasting multiple pre tags inside an existing code block means only the first one is correctly pasted
The expected behavior
All consecutive pre tags are collapsed into the same code block, or expanded to different code blocks, as long as no content is lost from the paste operation.
Impact of fix
Lower severity as not a lot of places copy disjointed pre tags, but notably, telemetry services like jenkins and humio do, so a lot of internal customers that rely on a workflow of creating a code block > pasting the logs are affected. This can be somewhat alleviated as not pre-creating the code block removes this issue, but we have still gotten reports from this awkward behavior.
Lexical version: v0.50.0+dev.esm
Steps To Reproduce
some text herethen an empty line then another code block with contentSome more text therewill be addedSome text herewill be copied, the second part is lost.The current behavior
Pasting multiple pre tags inside an existing code block means only the first one is correctly pasted
The expected behavior
All consecutive pre tags are collapsed into the same code block, or expanded to different code blocks, as long as no content is lost from the paste operation.
Impact of fix
Lower severity as not a lot of places copy disjointed pre tags, but notably, telemetry services like jenkins and humio do, so a lot of internal customers that rely on a workflow of creating a code block > pasting the logs are affected. This can be somewhat alleviated as not pre-creating the code block removes this issue, but we have still gotten reports from this awkward behavior.