diff --git a/lib/imageResize.ts b/lib/imageResize.ts index eb0bb04..7aef859 100644 --- a/lib/imageResize.ts +++ b/lib/imageResize.ts @@ -75,7 +75,10 @@ export const ImageResize = Image.extend({ $positionContainer.appendChild($container); const justifyContent = style.match(/justify-content: (.*?);/); - $positionContainer.setAttribute('style', `display: flex; ${justifyContent?.[0]}`); + $positionContainer.setAttribute( + 'style', + `display: flex; ${justifyContent ? justifyContent[0] : ''}`, + ); $container.setAttribute('style', `${style}`); $container.appendChild($img); diff --git a/package.json b/package.json index 61009fd..241ebe0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tiptap-extension-resize-image", - "version": "1.1.1", + "version": "1.1.2", "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",