Skip to content

Commit 3008917

Browse files
authored
Merge pull request #19 from noah-st-amand/master
Exclude trailing parenthesis from URL
2 parents 02b6846 + 8b92160 commit 3008917

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Autolink.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ function ($matches) use ($attribs, $linkNoScheme) {
126126
$url = substr($url, 0, -1);
127127
}
128128

129+
if (str_ends_with($url, ')')) {
130+
$suffix = ')';
131+
$url = substr($url, 0, -1);
132+
}
133+
129134
return $this->link($url, $attribs) . $suffix;
130135
},
131136
$text

0 commit comments

Comments
 (0)