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 existing fragment identifier in DOM.uid #114

Open
wants to merge 2 commits into
base: master
from

Conversation

@rreusser
Copy link

commented Aug 28, 2019

Appending "#" + id to window.location results in UID hrefs with two fragment identifiers. This commit removes the existing fragment identifier before appending the new one.

For an example of the currently-broken behavior, see https://observablehq.com/@mbostock/svg-clipping-test#foo. The preexisting fragment identifier #foo returns it to broken clipping.

Remove fragment identifier from DOM.uid
Concatenating `#` + id to `window.location` results in UID hrefs with _two_ fragment identifiers. This commit removes the existing fragment identifier before concatenating.

@rreusser rreusser changed the title Remove fragment identifier from DOM.uid Remove existing fragment identifier from DOM.uid Aug 28, 2019

@rreusser rreusser changed the title Remove existing fragment identifier from DOM.uid Remove existing fragment identifier in DOM.uid Aug 28, 2019

src/dom/uid.js Outdated Show resolved Hide resolved
src/dom/uid.js Outdated Show resolved Hide resolved
@rreusser

This comment has been minimized.

Copy link
Author

commented Sep 3, 2019

Good suggestion, @mbostock. I've updated the PR with that version.

@mbostock
Copy link
Member

left a comment

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.