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 xlink:href #543

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

benkasminbullock
Copy link
Contributor

No description provided.

@edent
Copy link
Owner

edent commented Jun 27, 2021

OK - this looks good. But I think you can go one step further and remove xmlns:xlink="http://www.w3.org/1999/xlink" from each file as well. That'll save even more space.

@PaulCapron
Copy link
Collaborator

PaulCapron commented Oct 7, 2021

Caution: it’s only in SVG 2 that a ‘naked’ href attribute can be used, instead of xlink:href.

Most browsers do support SVG 2, but many other programs do not (yet).

For instance, here is how the modified (using a naked href) Amazon S3 logo is seen, badly, by Ubuntu/Gnome image viewer:
Capture d’écran de 2021-10-07 13-01-33

Similarly, Inkscape (v0.92.5) does not properly understand a naked href.

@PaulCapron
Copy link
Collaborator

Note that the http://www.w3.org/1999/xlink namespace can be ‘nicknamed’ as anything, it isn’t required to be xlink.

I.e.:

<svg … xmlns:x="http://www.w3.org/1999/xlink">
  <use x:href="…"/>

is perfectly valid. Here http://www.w3.org/1999/xlink is ‘nicknamed’/referenced as simply x.

And that would save a couple bytes, without impacting compatibility with programs understanding only SVG 1.

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.

3 participants