diff --git a/lib/imageResize.ts b/lib/imageResize.ts index 0f1ce1e..7aff8f9 100644 --- a/lib/imageResize.ts +++ b/lib/imageResize.ts @@ -13,10 +13,9 @@ export const ImageResize = Image.extend({ default: 'width: 100%; height: auto; cursor: pointer;', parseHTML: element => { const width = element.getAttribute('width'); - if (!width || isNaN(Number(width))) { - return; - } - return `width: ${width}px; height: auto; cursor: pointer;`; + return width + ? `width: ${width}px; height: auto; cursor: pointer;` + : `${element.style.cssText}`; }, }, title: { diff --git a/package.json b/package.json index f99c019..0406658 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tiptap-extension-resize-image", - "version": "1.1.5", + "version": "1.1.6", "type": "module", "description": "A tiptap image resizing extension for React, Vue, Next, and VanillaJS. Additionally, it can align the image position.", "main": "dist/index.js",