When pasting from Ghostty into Lexical you get a code block, because of the <div style="font-family: monospace; white-space: pre;"> wrapper. However, the contents is full of unintended linebreaks because it treats each <div style="display: inline"> as having an implicit linebreak.
Ghostty arguably should be using a natively inline element for this, but it should be straightforward to address in the importDOM infrastructure (and whatever replaces it).
Lexical version: v0.44
Steps To Reproduce
- Select and copy some text from a Ghostty terminal
- Paste into the playground
Some example HTML from Ghostty's clipboard code:
<div style="font-family: monospace; white-space: pre;"><div style="display: inline;color: rgb(181, 189, 104);font-weight: bold;">❯</div> cd ~/src/lexical
<div style="display: inline;color: rgb(138, 190, 183);font-weight: bold;">lexical</div> on <div style="display: inline;color: rgb(178, 148, 187);font-weight: bold;"> main</div> <div style="display: inline;color: rgb(204, 102, 102);font-weight: bold;">[$⇣]</div> via <div style="display: inline;color: rgb(181, 189, 104);font-weight: bold;"> v22.17.0 </div>
<div style="display: inline;color: rgb(181, 189, 104);font-weight: bold;">❯</div> </div>
The current behavior
playground url
The expected behavior
playground url
Impact of fix
importDOM will work more predictably in cases where <div> is used as an inline element
When pasting from Ghostty into Lexical you get a code block, because of the
<div style="font-family: monospace; white-space: pre;">wrapper. However, the contents is full of unintended linebreaks because it treats each<div style="display: inline">as having an implicit linebreak.Ghostty arguably should be using a natively inline element for this, but it should be straightforward to address in the importDOM infrastructure (and whatever replaces it).
Lexical version: v0.44
Steps To Reproduce
Some example HTML from Ghostty's clipboard code:
The current behavior
playground url
The expected behavior
playground url
Impact of fix
importDOM will work more predictably in cases where
<div>is used as an inline element