Skip to content

Commit

Permalink
fix undefined align style
Browse files Browse the repository at this point in the history
  • Loading branch information
bae-sh committed May 15, 2024
1 parent 5a321e7 commit e1384ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/imageResize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit e1384ce

Please sign in to comment.