mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Permit empty links
This commit is contained in:
@@ -61,8 +61,8 @@ final class Link implements Inline
|
||||
|
||||
$remainder = \substr($remainder, $width);
|
||||
|
||||
if (\preg_match('/^[(]\s*+((?:[^ ()]++|[(][^ )]+[)])++)(?:[ ]+("[^"]*+"|\'[^\']*+\'))?\s*+[)]/', $remainder, $matches)) {
|
||||
$url = $matches[1];
|
||||
if (\preg_match('/^[(]\s*+(?:((?:[^ ()]++|[(][^ )]+[)])++)(?:[ ]+("[^"]*+"|\'[^\']*+\'))?\s*+)?[)]/', $remainder, $matches)) {
|
||||
$url = isset($matches[1]) ? $matches[1] : '';
|
||||
$title = isset($matches[2]) ? \substr($matches[2], 1, - 1) : null;
|
||||
|
||||
$width += \strlen($matches[0]);
|
||||
|
||||
Reference in New Issue
Block a user