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
粘贴时,去除不合法的html标签 但代码中获取的是粘贴前的html,所以也相当于没有过滤代码就直接粘贴了 建议用var clipboardData = e.clipboardData || e.originalEvent && e.originalEvent.clipboardData; 先获取到剪切板的数据,再getData出来,再把这里面的数据进行过滤吧
The text was updated successfully, but these errors were encountered:
麻烦提供下测试环境
Sorry, something went wrong.
跟测试环境无关,我是看的您的代码逻辑 //应该是想打印剪切板的内容 console.log(e.clipboardData.items); //编辑器里的包含html标签的内容存到content中 var content = $(this).html(); //打印content console.log(content); //获得配置的过滤符号 valiHTML = _this._opt.validHtml; //replace替换,替换的编辑器里的内容,而不是剪切板的内容 content = content.replace(/_moz_dirty=""/gi, "")........ if(...) {...} //用这个方法设置编辑器里的内容,最好还是document.execCommand('insertHTML', false, content);比较 //好吧,个人觉得 $(this).html(content);
No branches or pull requests
粘贴时,去除不合法的html标签
但代码中获取的是粘贴前的html,所以也相当于没有过滤代码就直接粘贴了
建议用var clipboardData = e.clipboardData || e.originalEvent && e.originalEvent.clipboardData;
先获取到剪切板的数据,再getData出来,再把这里面的数据进行过滤吧
The text was updated successfully, but these errors were encountered: