diff --git a/packages/extension-uploader/src/image/placeholder.ts b/packages/extension-uploader/src/image/placeholder.ts index 134b12f721ac4e90812e52f0faef2700a68952b4..df3e4d09881869162d89f969036f3077e9ba1415 100644 --- a/packages/extension-uploader/src/image/placeholder.ts +++ b/packages/extension-uploader/src/image/placeholder.ts @@ -34,11 +34,14 @@ export const handleUploadImages = ( if (isInTableCel) { imgWidth = tableCellWidth; } + const $pos = view.state.doc.resolve(pos); + const isBlock = !$pos.parent.inlineContent; //判断拖拽插入时光标是否为横线 tr.setMeta(ImagePlaceholderPlugin, { add: { id, - pos: pos + index, + // 光标为横线时dropcursor返回的pos会与默认不同,区分处理 + pos: isBlock ? pos : pos + 1, src: blobUrl, width: imgWidth, },