本文介绍了如何在contenteditable div中过滤用户粘贴的内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个允许contenteditable的div。
I have a div which allow contenteditable.
<div contenteditable="true">
</div>
我想过滤所有html标签复制和
I would like to filter all html tags copy & pasted from user (except ), how this could achieve in Dart code?
推荐答案
myDiv.onPaste.listen((e) {
// do filtering here and then insert the result imperatively
// one or both of the following might be necessary to prevent
// the default paste behavior happening as well.
e.preventDefault();
e.stopPropagation();
});
另请参阅:
-
-
这篇关于如何在contenteditable div中过滤用户粘贴的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!