Skip to content

Commit

Permalink
[lexical-markdown] Feature Change: Dont trim whitespaces on convertFr…
Browse files Browse the repository at this point in the history
…omMarkdownString (#6360)
  • Loading branch information
potatowagon authored Jul 2, 2024
1 parent ebc8d66 commit 131feee
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/lexical-markdown/src/MarkdownImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ function $importBlocks(
textFormatTransformersIndex: TextFormatTransformersIndex,
textMatchTransformers: Array<TextMatchTransformer>,
) {
const lineTextTrimmed = lineText.trim();
const textNode = $createTextNode(lineTextTrimmed);
const textNode = $createTextNode(lineText);
const elementNode = $createParagraphNode();
elementNode.append(textNode);
rootNode.append(elementNode);
Expand All @@ -135,7 +134,7 @@ function $importBlocks(
// If no transformer found and we left with original paragraph node
// can check if its content can be appended to the previous node
// if it's a paragraph, quote or list
if (elementNode.isAttached() && lineTextTrimmed.length > 0) {
if (elementNode.isAttached() && lineText.length > 0) {
const previousNode = elementNode.getPreviousSibling();
if (
$isParagraphNode(previousNode) ||
Expand Down

0 comments on commit 131feee

Please sign in to comment.