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

inlineStyles plugin should not remove id attribute from target element #2066

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

johnkenny54
Copy link
Contributor

Removed code that deletes id attribute from elements.

Resolves #2065.

@strarsis
Copy link
Contributor

strarsis commented Aug 29, 2024

Wouldn't an option be better? Subsequent plugins do not have the context to clean up the ID attribute, as it is removed by inline styles as being then unnecessary, as its associated styles were directly applied to the element.
PR that adds the options: #1165

@johnkenny54
Copy link
Contributor Author

Having an option isn't safe and just adds complexity to the plugin. If the id is no longer referenced, it should be removed by cleanupIds. Currently cleanupIds disables itself in the presence of <style> elements, which is not ideal, but at least preferable to what many other plugins do, since it doesn't break anything. But there's no reason cleanupIds couldn't check the selectors to see which ids are referenced by styles.

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

Successfully merging this pull request may close these issues.

inlineStyles plugin should not remove id attribute from target element
2 participants