Skip to content

Commit

Permalink
Add Optional Chaining to isNodePre Method (#5157)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickjmoss authored Oct 27, 2023
1 parent 62f2fc5 commit dbb0813
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/lexical/src/nodes/LexicalTextNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1138,6 +1138,8 @@ function isNodePre(node: Node): boolean {
return (
node.nodeName === 'PRE' ||
(node.nodeType === DOM_ELEMENT_TYPE &&
(node as HTMLElement).style !== undefined &&
(node as HTMLElement).style.whiteSpace !== undefined &&
(node as HTMLElement).style.whiteSpace.startsWith('pre'))
);
}
Expand Down

2 comments on commit dbb0813

@vercel
Copy link

@vercel vercel bot commented on dbb0813 Oct 27, 2023

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-fbopensource.vercel.app
lexical-git-main-fbopensource.vercel.app
lexical.dev
lexicaljs.org
lexicaljs.com
www.lexical.dev

@vercel
Copy link

@vercel vercel bot commented on dbb0813 Oct 27, 2023

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
lexical-playground-fbopensource.vercel.app
playground.lexical.dev

Please sign in to comment.