We have a use case where we want the editor to only store/support certain html tags, i.e. the tags supported by the limited set of buttons we enable for the editor. However users are able to copy and paste html into the editor that doesn't conform to the supported tags that they would have if they were entering the content manually.
From an implementation standpoint what we'd like is that when the user is pasting from a source, such as Word, that either all html tags are removed, or that only html tags from a whitelist we maintain are allowed to be pasted (where non-supported tags would be stripped).
I found this article on stackoverflow and wondered if you have thoughts on how we might implement this?
I think my option of last resort is to implement a validator that detects "bad" html and notifies the user and doesn't allow saving, but this doesn't seem ideal. Any suggestions are appreciated.
We have a use case where we want the editor to only store/support certain html tags, i.e. the tags supported by the limited set of buttons we enable for the editor. However users are able to copy and paste html into the editor that doesn't conform to the supported tags that they would have if they were entering the content manually.
From an implementation standpoint what we'd like is that when the user is pasting from a source, such as Word, that either all html tags are removed, or that only html tags from a whitelist we maintain are allowed to be pasted (where non-supported tags would be stripped).
I found this article on stackoverflow and wondered if you have thoughts on how we might implement this?
https://stackoverflow.com/questions/49709031/ckeditor-5-paste-as-plain-text
I think my option of last resort is to implement a validator that detects "bad" html and notifies the user and doesn't allow saving, but this doesn't seem ideal. Any suggestions are appreciated.