We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7bd6931 commit 71bfa0cCopy full SHA for 71bfa0c
src/Renderer/HtmlRenderer.php
@@ -638,7 +638,7 @@ static function (array $matches): string {
638
}
639
640
$parts = preg_split(
641
- '/(\[[^]]+]\([^)]+\)|`[^`]+`)/',
+ '/(\[[^]]+]\([^\s)]+(?:\)[^\s)]*)*\)|`[^`]+`)/',
642
$paragraph,
643
-1,
644
PREG_SPLIT_DELIM_CAPTURE,
@@ -650,7 +650,7 @@ static function (array $matches): string {
650
continue;
651
652
653
- if (preg_match('/^\[([^]]+)]\(([^)]+)\)$/', $part, $matches) === 1) {
+ if (preg_match('/^\[([^]]+)]\(([^\\s)]+(?:\)[^\\s)]*)*)\)$/', $part, $matches) === 1) {
654
if (preg_match('/^https?:\/\//i', $matches[2]) === 1) {
655
$html .= '<a href="' . $this->htmlEncode($matches[2]) . '">'
656
. $this->htmlEncode($matches[1])
0 commit comments