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

Remove xmlns:xlink in removeXMLNS plugin #1508

Merged
merged 1 commit into from
Oct 15, 2021
Merged

Conversation

devongovett
Copy link
Contributor

xmlns:xlink is also not required in SVGs embedded in HTML

xmlns:xlink is also not required in SVGs embedded in HTML
@TrySound
Copy link
Member

TrySound commented Aug 2, 2021

Hi @devongovett. Thanks for PR. I think removeUnusedNS.js removes xmlns:xlink.

@devongovett
Copy link
Contributor Author

That only removes it if it's unused though. In this case, it's always safe to remove xlink:href in HTML. Since this plugin is opt-in, I think it makes sense to do it here as well.

@TrySound
Copy link
Member

TrySound commented Aug 14, 2021

I think it's better to create a separate plugin which removes xlink namespace from xlink:herf as well.
Otherwise some images may be broken.
I can take care of it in a few days.

TrySound added a commit that referenced this pull request Aug 22, 2021
Ref #1508

The new plugin removes xmlns:xlink from <svg> and replaces xlink:href
with href attribute.

xlink namespace is obsolete in SVG 2. Href attribute is recommended
replacement to xlink:href.

This plugin will be enabled by default in SVGO 3.

See https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/href
@TrySound TrySound merged commit 2d6deea into svg:master Oct 15, 2021
@TrySound
Copy link
Member

I think it should be safe enough. We can always revert if somebody come with issues.

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