Skip to content

fix(removeAttributesBySelector): update for v2 API#1978

Open
soren121 wants to merge 4 commits into
svg:mainfrom
soren121:remove-attributes-by-selector
Open

fix(removeAttributesBySelector): update for v2 API#1978
soren121 wants to merge 4 commits into
svg:mainfrom
soren121:remove-attributes-by-selector

Conversation

@soren121
Copy link
Copy Markdown
Contributor

@soren121 soren121 commented Apr 8, 2024

This is a general cleanup PR for the removeAttributesBySelector plugin. It was never updated for the v2 API, and its doc page was not very clear on how to use it; this PR addresses both.

Changes

  • Plugin was updated to use the V2 API
  • Added a check to avoid runtime errors when plugin is not configured, or misconfigured
  • Added a test to ensure plugin is a no-op when not configured
  • Expanded and clarified the plugin's doc page
  • Added TypeScript parameter types

edit: other changes merged as #2215

@KTibow KTibow added the merge conflicts Changes currently conflict with main label Mar 8, 2026
@soren121
Copy link
Copy Markdown
Contributor Author

soren121 commented Apr 7, 2026

@KTibow Are you interested in merging this? Respectfully, this PR is two years old, I'm not going to put in effort keeping it up-to-date if it's not going anywhere.

@KTibow
Copy link
Copy Markdown
Collaborator

KTibow commented Apr 7, 2026

Just let me know when you update it and I'll run CI and review it.

@soren121 soren121 force-pushed the remove-attributes-by-selector branch from 9aaf1a4 to 6deb8db Compare April 7, 2026 18:30
@soren121 soren121 force-pushed the remove-attributes-by-selector branch from 6deb8db to 6864872 Compare April 7, 2026 18:41
@soren121
Copy link
Copy Markdown
Contributor Author

soren121 commented Apr 7, 2026

@KTibow Thanks! Conflicts fixed & ready for review again.

@KTibow KTibow removed the merge conflicts Changes currently conflict with main label Apr 7, 2026
KTibow added a commit that referenced this pull request Apr 9, 2026
…2215)

I'm uncertain if the switch to `matches` in #1978 is a good idea
perfwise. But it has a subset which are clearly good ideas, so this PR
is just those.

- better documentation
- better types
- warning on incorrect configuration
- more tests

---------

Co-authored-by: soren121 <soren121@users.noreply.github.com>
@soren121 soren121 changed the title fix(removeAttributesBySelector): update for v2 API, better docs, add parameter types fix(removeAttributesBySelector): update for v2 API Apr 9, 2026
@soren121 soren121 force-pushed the remove-attributes-by-selector branch from 7aa82e1 to f6153d7 Compare April 9, 2026 18:58
@soren121 soren121 force-pushed the remove-attributes-by-selector branch from f6153d7 to fd06994 Compare April 9, 2026 19:04
@soren121
Copy link
Copy Markdown
Contributor Author

soren121 commented Apr 9, 2026

I don't have much of an opinion on whether matches or querySelectorAll is better...if I remember correctly, I copied the matches idea from another plugin. It would be nice to migrate to the new plugin API, as I've done here, but apart from that, 🤷🏽.

Feel free to close this if you're not interested in the remaining changes.

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.

2 participants