Skip to content

Commit

Permalink
Allow an empty paragraph child on converting from markdown (#5517)
Browse files Browse the repository at this point in the history
  • Loading branch information
2wheeh authored Jan 26, 2024
1 parent 86c6197 commit 5ef89dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/lexical-markdown/src/MarkdownImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ export function createMarkdownImport(
}

// Removing empty paragraphs as md does not really
// allow empty lines and uses them as dilimiter
// allow empty lines and uses them as delimiter
const children = root.getChildren();
for (const child of children) {
if (isEmptyParagraph(child)) {
if (isEmptyParagraph(child) && root.getChildrenSize() > 1) {
child.remove();
}
}
Expand Down

2 comments on commit 5ef89dd

@vercel
Copy link

@vercel vercel bot commented on 5ef89dd Jan 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lexical – ./packages/lexical-website

lexical.dev
lexical-git-main-fbopensource.vercel.app
lexical-fbopensource.vercel.app
lexicaljs.com
lexicaljs.org
www.lexical.dev

@vercel
Copy link

@vercel vercel bot commented on 5ef89dd Jan 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lexical-playground – ./packages/lexical-playground

lexical-playground-git-main-fbopensource.vercel.app
lexical-playground.vercel.app
playground.lexical.dev
lexical-playground-fbopensource.vercel.app

Please sign in to comment.