修改火狐粘贴富文本,没有段落的错误

This commit is contained in:
jacky 2024-05-09 12:44:09 +08:00
parent c143ba52d9
commit b77c4ef697
1 changed files with 1 additions and 0 deletions

View File

@ -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()