Skip to content

Commit

Permalink
Backport PR jupyterlab#7215: Fix overwriting of target attribute of a…
Browse files Browse the repository at this point in the history
…nchors rendered by IPython.display
  • Loading branch information
blink1073 authored and MeeseeksDev[bot] committed Sep 18, 2019
1 parent 15d0c23 commit 597bff5
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 597bff5

Please sign in to comment.