From e1384cef50703ebc0e27f23fb97d40de59665790 Mon Sep 17 00:00:00 2001 From: bae-sh Date: Wed, 15 May 2024 22:27:33 +0900 Subject: [PATCH] fix undefined align style --- lib/imageResize.ts | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) 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",