-
-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
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
Customizing allowed tags in cleanHTML #203
Comments
Hi @Mistralys The whitelist is a list of tags that the editor allows. This means that the tags allowed by the editor and the tags allowed when pasting are different. |
Hi @JiHong88, yes, I want to keep only specific tags when pasting. You are right, that's different from the tags the editor allows, which do not necessarily have to be the same set of tags. What I am trying to do with a whitelist when pasting is this:
Ideally, it should be possible to change the whitelist on the fly, which I could easily implement if the onPaste event allowed modifying the HTML. What do you think? And thanks for the reply :) |
Yes I can make related options. |
Hi JiHong88, thanks, that would be great! What do you mean with the immediate change for end users? |
No sorry, forget it. |
Awesome, thanks a lot! Looks good :) |
The 2.26.0 version has been updated. |
Hello,
I am trying to filter pasted text to keep only a specific set of tags, and to offer the option to paste as plain text.
I saw that there is a whitelist of tags here, which is used when cleaning the pastedHTML:
https://github.com/JiHong88/SunEditor/blob/master/src/lib/util.js#L1080
It would be great if it was possible to influence this list somehow.
Alternatively, it would be great if we could modify the cleaned HTML before it is pasted. The onPaste event only allows cancelling the event, not modifying the HTML.
What do you think, would something like that be possible, or is there an existing way that I overlooked?
The text was updated successfully, but these errors were encountered: