1
0
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:
Jukka Rautanen 2018-06-11 15:54:42 +03:00 committed by GitHub
parent ba3b60d6e4
commit 4c77cc7aa7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}