Skip to content

Conversation

rreusser
Copy link
Contributor

@rreusser rreusser 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.

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
@rreusser
Copy link
Contributor Author

rreusser commented Sep 3, 2019

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

Copy link
Member

@mbostock mbostock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@mbostock
Copy link
Member

Merged into #128 for 3.2.

@mbostock mbostock closed this Oct 29, 2019
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