mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
improve CommonMark compliance
This commit is contained in:
parent
b4a8eb3315
commit
79d924040a
@ -1212,12 +1212,20 @@ class Parsedown
|
|||||||
|
|
||||||
protected function inlineTag($excerpt)
|
protected function inlineTag($excerpt)
|
||||||
{
|
{
|
||||||
if ($this->markupEscaped)
|
if ($this->markupEscaped or strpos($excerpt, '>') === false)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strpos($excerpt, '>') !== false and preg_match('/^<\/?\w.*?>/s', $excerpt, $matches))
|
if (preg_match('/^<\w*(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*\/?>/s', $excerpt, $matches))
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
'markup' => $matches[0],
|
||||||
|
'extent' => strlen($matches[0]),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($excerpt[1] === '/' and preg_match('/^<\/\w*[ ]*>/s', $excerpt, $matches))
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'markup' => $matches[0],
|
'markup' => $matches[0],
|
||||||
|
Loading…
Reference in New Issue
Block a user