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
@ -83,6 +83,15 @@ class Parsedown
|
|||||||
|
|
||||||
protected $urlsLinked = true;
|
protected $urlsLinked = true;
|
||||||
|
|
||||||
|
function setUrlsTarget($urlsTarget)
|
||||||
|
{
|
||||||
|
$this->urlsTarget = $urlsTarget;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected $urlsTarget = false;
|
||||||
|
|
||||||
function setSafeMode($safeMode)
|
function setSafeMode($safeMode)
|
||||||
{
|
{
|
||||||
$this->safeMode = (bool) $safeMode;
|
$this->safeMode = (bool) $safeMode;
|
||||||
@ -1535,6 +1544,10 @@ class Parsedown
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ($this->urlsTarget === true) {
|
||||||
|
$Inline['element']['attributes']['target'] = '_blank';
|
||||||
|
}
|
||||||
|
|
||||||
return $Inline;
|
return $Inline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user