Skip to content

Commit

Permalink
Only set target when it hasn't been set
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspervriends committed Mar 19, 2021
1 parent 8801108 commit 1f44392
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Formatter/FormatLinks.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ public function __invoke(Renderer $renderer, $context, $xml, Request $request =
$attributes['rel'] = "ugc noopener" . ($this->addNofollow($domain) ? " nofollow" : "");

// Open link in new tab
$attributes['target'] = $this->openInNewTab($domain) ? "_blank" : "_self";
if(!isset($attributes['target'])) {
$attributes['target'] = $this->openInNewTab($domain) ? "_blank" : "_self";
}

return $attributes;
});
Expand Down

0 comments on commit 1f44392

Please sign in to comment.