Merge pull request #155 from Ilymfa/main

fix: image options defaultSize
This commit is contained in:
Michael Yang 2025-03-05 17:12:02 +08:00 committed by GitHub
commit 3ca72ae89b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -241,7 +241,7 @@ export const ImageExt = Image.extend<ImageOptions>({
const container = document.createElement('div')
const {src, width, height, align, alt} = props.node.attrs;
const imgWidth = getWidthUnit(width || 350);
const imgWidth = getWidthUnit(width || this.options.defaultSize);
const wrapperStyle = imgWidth.indexOf("%") > 0 ? `style="width: ${imgWidth};"` : "";
const calcImgWidth = imgWidth.indexOf("%") > 0 ? `calc(100% - 2px)` : imgWidth;
container.classList.add(`align-${align}`)