I have a div which allow contenteditable.
<div contenteditable="true">
</div>
I would like to filter all html tags copy & pasted from user (except ), how this could achieve in Dart code?
I have a div which allow contenteditable.
<div contenteditable="true">
</div>
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();
});
See also:
- https://stackoverflow.com/a/3933677/217408
- Detect a paste event in a contenteditable