1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

Allow empty code spans

This commit is contained in:
Aidan Woods 2019-01-27 17:10:36 +00:00
parent 50e135cd4e
commit 62615f4fc5
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9

View File

@ -40,7 +40,7 @@ final class Code implements Inline
}
if (\preg_match(
'/^(['.$marker.']++)[ ]*+(.+?)[ ]*+(?<!['.$marker.'])\1(?!'.$marker.')/s',
'/^(['.$marker.']++)[ ]*+(.*?)[ ]*+(?<!['.$marker.'])\1(?!'.$marker.')/s',
$Excerpt->text(),
$matches
)) {
@ -48,6 +48,8 @@ final class Code implements Inline
return new self($text, \strlen($matches[0]));
}
return null;
}
/**