0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2025-02-03 12:48:43 -05:00

#472 fixed contenteditable=false elements being merged when they shouldn't, fixed compilation error caused by missing nullcheck

This commit is contained in:
Alexander Gratzl 2024-11-29 14:49:13 +01:00
parent bb795b04bb
commit 2293b4a12b
2 changed files with 3 additions and 2 deletions

View file

@ -2122,7 +2122,7 @@ class Squire {
break;
}
if (!(child as HTMLElement).isContentEditable) {
if (child && !(child as HTMLElement).isContentEditable) {
replaceWith(child, document.createTextNode('') as Text);
break;
}

View file

@ -42,7 +42,8 @@ const areAlike = (
return (
node.nodeName !== 'A' &&
node.className === node2.className &&
node.style.cssText === node2.style.cssText
node.style.cssText === node2.style.cssText &&
(node as HTMLElement).isContentEditable && (node2 as HTMLElement).isContentEditable
);
}
return true;