mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Allow setting target for URLs
This commit is contained in:
parent
ba3b60d6e4
commit
4c77cc7aa7
@ -82,6 +82,15 @@ class Parsedown
|
||||
}
|
||||
|
||||
protected $urlsLinked = true;
|
||||
|
||||
function setUrlsTarget($urlsTarget)
|
||||
{
|
||||
$this->urlsTarget = $urlsTarget;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
protected $urlsTarget = false;
|
||||
|
||||
function setSafeMode($safeMode)
|
||||
{
|
||||
@ -1534,6 +1543,10 @@ class Parsedown
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
if ($this->urlsTarget === true) {
|
||||
$Inline['element']['attributes']['target'] = '_blank';
|
||||
}
|
||||
|
||||
return $Inline;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user