Skip to content

Commit

Permalink
Fix: Resolve "Cannot read properties of undefined (reading 'trim')" i…
Browse files Browse the repository at this point in the history
…ssue in $getSelectionStyleValueForProperty (#5271)
  • Loading branch information
yeion7 committed Nov 23, 2023
1 parent 303530a commit 7ec15be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/lexical-selection/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ export function getStyleObjectFromRawCSS(css: string): Record<string, string> {
for (const style of styles) {
if (style !== '') {
const [key, value] = style.split(/:([^]+)/); // split on first colon
styleObject[key.trim()] = value.trim();
if (key && value) {
styleObject[key.trim()] = value.trim();
}
}
}

Expand Down

2 comments on commit 7ec15be

@vercel
Copy link

@vercel vercel bot commented on 7ec15be Nov 23, 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-git-main-fbopensource.vercel.app
lexical.dev
lexical-fbopensource.vercel.app
lexicaljs.org
www.lexical.dev
lexicaljs.com

@vercel
Copy link

@vercel vercel bot commented on 7ec15be Nov 23, 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
playground.lexical.dev
lexical-playground-fbopensource.vercel.app

Please sign in to comment.