FIX: URL links in SVG should have target='_blank'#31578
Open
timhoffm wants to merge 1 commit intomatplotlib:mainfrom
Open
FIX: URL links in SVG should have target='_blank'#31578timhoffm wants to merge 1 commit intomatplotlib:mainfrom
timhoffm wants to merge 1 commit intomatplotlib:mainfrom
Conversation
When embedding SVG in HTML, link `href`s can target different browsing contexts. This e.g. leads to links inside SVGs in matplotlib#31497 replacing the SVG image instead of opening a new browser window. The solution is to set `target="_blank"` for all links that implement `Artist.get_url()`. This is always intended as an external link, so universally adding `target="_blank"` is justified. Background info: https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/target https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/target#_blank
b45c9b8 to
49b03ff
Compare
Member
|
This is a bit of a change in behaviour - I tried the SVG url demo example, and before this PR the link opens in the same window, and after it opens in a new window. Using It should definitely get a release note though, and optionally this might be a good oppurtunity to de-duplicate at least |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When embedding SVG in HTML, link
hrefs can target different browsing contexts. This e.g. leads to links inside SVGs in #31497 replacing the SVG image instead of opening a new browser window.The solution is to set
target="_blank"for all links that implementArtist.get_url(). This is always intended as an external link, so universally addingtarget="_blank"is justified.Background info:
https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/target
https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/target#_blank