Skip to content

Commit 698c013

Browse files
committed
fix: 复制单张图片无效
1 parent feac0af commit 698c013

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/text/event-hooks/paste-text-html.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,15 @@ function pasteTextHtml(editor: Editor, pasteEvents: Function[]) {
163163
$topElem.remove()
164164
}
165165
} else {
166+
editor.cmd.do('insertHTML', html)
167+
166168
// 如果用户从百度等网站点击复制得到的图片是一串img标签且待src的http地址
167169
// 见 https://github.com/wangeditor-team/wangEditor/issues/3119
168170
// 如果是走用户定义的图片上传逻辑
169-
const isHasOnlyImgEleReg = /^<img [^>]*src=['"]([^'"]+)[^>]*>$/g
170-
if (!isHasOnlyImgEleReg.test(html)) {
171-
editor.cmd.do('insertHTML', html)
172-
}
171+
// const isHasOnlyImgEleReg = /^<img [^>]*src=['"]([^'"]+)[^>]*>$/g
172+
// if (!isHasOnlyImgEleReg.test(html)) {
173+
// editor.cmd.do('insertHTML', html)
174+
// }
173175
}
174176
}
175177
} catch (ex) {

0 commit comments

Comments
 (0)