Skip to content
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

Request: pasteAttributesBlacklist Option #895

Closed
machineghost opened this issue Nov 18, 2021 · 1 comment
Closed

Request: pasteAttributesBlacklist Option #895

machineghost opened this issue Nov 18, 2021 · 1 comment
Labels
Milestone

Comments

@machineghost
Copy link

machineghost commented Nov 18, 2021

Is your feature request related to a problem? Please describe.
Currently you can whitelist attributes with the attributesWhitelist ... but what if you want to allow all attributes except (say) style attributes? You might want to do this to prevent pasted-in HTML from containing any styles (eg. color: white), as they might not look good on the page, but you don't want to lose any other important attributes. Unfortunately, there's no way to do it.

Also, what if you only care about pasted-in HTML? For tags there are the two options pasteTagsBlacklist and pasteTagsWhitelist, but for attributes no such option exists.

Describe the solution you'd like
My proposed new option would work exactly like pasteTagsBlacklist, only for attributes instead of tags. Which is to say it would work like attributesWhitelist, only in reverse (being a blacklist), and it would only screen out attributes from pasted-in text.

Describe alternatives you've considered
It seems impossible (or at least extremely difficult) to otherwise prevent style attributes from being pasted-in, without having to list out every other possible attribute in the entire HTML spec.

Additional context
Add any other context or screenshots about the feature request here.

@JiHong88 JiHong88 added this to the 2.42.0 milestone Nov 29, 2021
JiHong88 added a commit that referenced this issue Nov 29, 2021
@JiHong88
Copy link
Owner

The 2.42.0 version has been updated.
If this issue has not been resolved, please reopen this issue.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants