diff --git a/packages/svelte-lexical/src/lib/core/plugins/Image/ImageNode.ts b/packages/svelte-lexical/src/lib/core/plugins/Image/ImageNode.ts index 904aa81..45163cb 100644 --- a/packages/svelte-lexical/src/lib/core/plugins/Image/ImageNode.ts +++ b/packages/svelte-lexical/src/lib/core/plugins/Image/ImageNode.ts @@ -34,9 +34,18 @@ export interface ImagePayload { captionsEnabled?: boolean; } +function isGoogleDocCheckboxImg(img: HTMLImageElement): boolean { + return ( + img.parentElement != null && + img.parentElement.tagName === 'LI' && + img.previousSibling === null && + img.getAttribute('aria-roledescription') === 'checkbox' + ); +} + function convertImageElement(domNode: Node): null | DOMConversionOutput { const img = domNode as HTMLImageElement; - if (img.src.startsWith('file:///')) { + if (img.src.startsWith('file:///') || isGoogleDocCheckboxImg(img)) { return null; } const {alt: altText, src, width, height} = img;