富文本编辑器editor的 insertImage API,如何去掉自动多出的空行?
发布于 5 年前 作者 xiulan57 847 次浏览 来自 官方Issues

富文本编辑器editor的 insertImage API,插入图片后会多了个<p><br></p>

let that = this;
this.editorCtx.insertImage({
    src: "https://www.hongbk.club/emotion/"+this.emotion[index].name+".png",
    extClass: 'emoji_img',
    success() {
        that.editorCtx.getContents({
            success(res) {
                console.log(res.html)
            }
        }) 
    }
})

打印的结果:

2 回复

谢邀,没玩过,replace不行吗

移动端插入图片后,为方便用户跳到下一行,insertImage 后会插入一个空行,这个之前你不是问过吗。。应该去不掉

回到顶部