diff --git a/src/Autolink.php b/src/Autolink.php index 66187eb..e71d12a 100644 --- a/src/Autolink.php +++ b/src/Autolink.php @@ -126,6 +126,11 @@ function ($matches) use ($attribs, $linkNoScheme) { $url = substr($url, 0, -1); } + if (str_ends_with($url, ')')) { + $suffix = ')'; + $url = substr($url, 0, -1); + } + return $this->link($url, $attribs) . $suffix; }, $text