Skip to content

Commit

Permalink
Merge pull request #7231 from meeseeksmachine/auto-backport-of-pr-721…
Browse files Browse the repository at this point in the history
…5-on-1.x

Backport PR #7215 on branch 1.x (Fix overwriting of target attribute of anchors rendered by IPython.display)
  • Loading branch information
jasongrout committed Sep 18, 2019
2 parents 15d0c23 + 597bff5 commit ca2453d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/rendermime/src/renderers.ts
Expand Up @@ -597,10 +597,12 @@ namespace Private {
resolver && resolver.isLocal
? resolver.isLocal(path)
: URLExt.isLocal(path);
if (isLocal) {
el.target = '_self';
} else {
el.target = '_blank';
// set target attribute if not already present
if (!el.target) {
el.target = isLocal ? '_self' : '_blank';
}
// set rel as 'noopener' for non-local anchors
if (!isLocal) {
el.rel = 'noopener';
}
}
Expand Down

0 comments on commit ca2453d

Please sign in to comment.