Skip to content

Commit 71bfa0c

Browse files
dbuhonovCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
1 parent 7bd6931 commit 71bfa0c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Renderer/HtmlRenderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ static function (array $matches): string {
638638
}
639639

640640
$parts = preg_split(
641-
'/(\[[^]]+]\([^)]+\)|`[^`]+`)/',
641+
'/(\[[^]]+]\([^\s)]+(?:\)[^\s)]*)*\)|`[^`]+`)/',
642642
$paragraph,
643643
-1,
644644
PREG_SPLIT_DELIM_CAPTURE,
@@ -650,7 +650,7 @@ static function (array $matches): string {
650650
continue;
651651
}
652652

653-
if (preg_match('/^\[([^]]+)]\(([^)]+)\)$/', $part, $matches) === 1) {
653+
if (preg_match('/^\[([^]]+)]\(([^\\s)]+(?:\)[^\\s)]*)*)\)$/', $part, $matches) === 1) {
654654
if (preg_match('/^https?:\/\//i', $matches[2]) === 1) {
655655
$html .= '<a href="' . $this->htmlEncode($matches[2]) . '">'
656656
. $this->htmlEncode($matches[1])

0 commit comments

Comments
 (0)