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:
parent
50e135cd4e
commit
62615f4fc5
|
@ -40,7 +40,7 @@ final class Code implements Inline
|
||||||
}
|
}
|
||||||
|
|
||||||
if (\preg_match(
|
if (\preg_match(
|
||||||
'/^(['.$marker.']++)[ ]*+(.+?)[ ]*+(?<!['.$marker.'])\1(?!'.$marker.')/s',
|
'/^(['.$marker.']++)[ ]*+(.*?)[ ]*+(?<!['.$marker.'])\1(?!'.$marker.')/s',
|
||||||
$Excerpt->text(),
|
$Excerpt->text(),
|
||||||
$matches
|
$matches
|
||||||
)) {
|
)) {
|
||||||
|
@ -48,6 +48,8 @@ final class Code implements Inline
|
||||||
|
|
||||||
return new self($text, \strlen($matches[0]));
|
return new self($text, \strlen($matches[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user