Skip to content

Commit

Permalink
[lexical-table] [lexical-selection] Try to fix calling split on undef…
Browse files Browse the repository at this point in the history
…ined (#6746)
  • Loading branch information
ivailop7 authored Oct 21, 2024
1 parent 1b4f1e0 commit 6e299aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/lexical-selection/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ export function createRectsFromDOMRange(
*/
export function getStyleObjectFromRawCSS(css: string): Record<string, string> {
const styleObject: Record<string, string> = {};
if (!css) {
return styleObject;
}
const styles = css.split(';');

for (const style of styles) {
Expand Down
2 changes: 1 addition & 1 deletion packages/lexical-table/src/LexicalTableCellNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ export function $convertTableCellNodeElement(
}

const style = domNode_.style;
const textDecoration = style.textDecoration.split(' ');
const textDecoration = ((style && style.textDecoration) || '').split(' ');
const hasBoldFontWeight =
style.fontWeight === '700' || style.fontWeight === 'bold';
const hasLinethroughTextDecoration = textDecoration.includes('line-through');
Expand Down

0 comments on commit 6e299aa

Please sign in to comment.