修改火狐粘贴富文本,没有段落的错误
This commit is contained in:
parent
c143ba52d9
commit
b77c4ef697
|
|
@ -75,6 +75,7 @@ const handleCreated = (editor) => {
|
|||
|
||||
const customPaste = (editor, event, callback) => {
|
||||
let htmlData = event.clipboardData.getData('text/html') // 获取粘贴的 html
|
||||
htmlData = htmlData.replace(/<\/?span[^>]*>/g, '');
|
||||
htmlData = htmlData.replace('<img', '<img referrerpolicy="no-referrer"')
|
||||
editor.dangerouslyInsertHtml(htmlData);
|
||||
event.preventDefault()
|
||||
|
|
|
|||
Loading…
Reference in New Issue