We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用 dangerouslyInsertHtml 方法,全选编辑器内容后粘贴,在首行莫名其妙插入了空行里面只有一个 字符
未插入空行和 字符
"@wangeditor/editor": "^5.1.23", "@wangeditor/editor-for-vue": "^5.1.10",
能/不能
请尽量提供在线 demo (推荐以下网站),帮助我们最低成本复现 bug
(请告诉我们,如何最快的复现该 bug)
粘贴文本来源:飞书在线文档表格,单元格内的富文本
<Editor v-model="valueHtml" :defaultConfig="editorConfig" :editorId="editorId" :style="editorStyle" @custom-paste="handleCustomPaste" />
import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
function handleCustomPaste(editor, event, callback) { const html = event.clipboardData.getData('text/html') // 获取粘贴的 html const text = event.clipboardData.getData('text/plain') // 获取粘贴的纯文本 const rtf = event.clipboardData.getData('text/rtf') // 获取 rtf 数据(如从 word wsp 复制粘贴)
editor.dangerouslyInsertHtml(html)
// 阻止默认的粘贴行为 event.preventDefault() callback(false); // 返回 false ,阻止默认粘贴行为 return false }
The text was updated successfully, but these errors were encountered:
解决了吗?
Sorry, something went wrong.
没有,因为是自己用的后台,所以就手动删除空行了
No branches or pull requests
bug 描述
使用 dangerouslyInsertHtml 方法,全选编辑器内容后粘贴,在首行莫名其妙插入了空行里面只有一个 字符
你预期的样子是?
未插入空行和 字符
系统和浏览器及版本号
wangEditor 版本
demo 能否复现该 bug ?
能/不能
在线 demo
请尽量提供在线 demo (推荐以下网站),帮助我们最低成本复现 bug
最小成本的复现步骤
(请告诉我们,如何最快的复现该 bug)
粘贴文本来源:飞书在线文档表格,单元格内的富文本
import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
function handleCustomPaste(editor, event, callback) {
const html = event.clipboardData.getData('text/html') // 获取粘贴的 html
const text = event.clipboardData.getData('text/plain') // 获取粘贴的纯文本
const rtf = event.clipboardData.getData('text/rtf') // 获取 rtf 数据(如从 word wsp 复制粘贴)
editor.dangerouslyInsertHtml(html)
// 阻止默认的粘贴行为
event.preventDefault()
callback(false); // 返回 false ,阻止默认粘贴行为
return false
}
The text was updated successfully, but these errors were encountered: