Skip to content

Commit

Permalink
Fix whitespace stripping issue in textDOMNode conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Tranquiliz00 committed Jan 10, 2025
1 parent 541fa43 commit a96c88f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/lexical/src/nodes/LexicalTextNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,10 @@ function $convertTextDOMNode(domNode: Node): DOMConversionOutput {
}
return {node: nodes};
}
textContent = textContent.replace(/\r/g, '').replace(/[ \t\n]+/g, ' ');
textContent = textContent
.replace(/\r/g, '')
.replace(/[\t\n]+/g, ' ')
.replace(/[ ]/g, ' ');
if (textContent === '') {
return {node: null};
}
Expand Down

0 comments on commit a96c88f

Please sign in to comment.