facebook / facebook/lexical

Bug: Lexical RichText is not keeping empty lines between sentences on specific case

Open
#4,830 6 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
23.9k
Forks
2.2k
Avg merge
1d 16h
Merged PRs (30d)
61

Description

Lexical version: 0.11.3

## Steps To Reproduce

1. Create and send an Email using Gmail
1.1. The email needs to have empty lines between paragraphs
2. Copy email's body

The pasted DataTransfer data

```html


Text





Text 2










Text 3







Text 4 

 


google


```

3. Paste email's body specifically on Lexical RichText Editor

Link to code example: [CodeSandBox](https://codesandbox.io/s/dazzling-stonebraker-8pwxhw?file=/src/Editor.js)

## The current behavior

| Creating email | Copying email | Pasting on Lexical Rich Text Editor |
| --- | --- | --- |
| Screenshot 2023-07-26 at 11 06 58 AM | Screenshot 2023-07-26 at 10 42 20 AM | Screenshot 2023-07-26 at 11 14 29 AM |

## The expected behavior

Expect Lexical RichText Editor to keep empty lines between sentences

Contributor guide

Open the contributing guide

Research direction

Start with the linked CodeSandbox at src/Editor.js and reproduce the Gmail HTML paste in the Lexical RichText Editor. Trace how the pasted DataTransfer HTML is handled, using the supplied empty div and br cases as the fixture. Done means the editor preserves the empty lines between Text, Text 2, Text 3, and Text 4.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.