change the parsing order of tag elements to improve performance

This commit is contained in:
Emanuil Rusev 2015-01-16 01:46:43 +02:00
parent 05a8f16e95
commit 3b4aa6bff7
1 changed files with 8 additions and 8 deletions

View File

@ -1217,14 +1217,6 @@ class Parsedown
return;
}
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(
@ -1240,6 +1232,14 @@ class Parsedown
'extent' => strlen($matches[0]),
);
}
if (preg_match('/^<\w*(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*\/?>/s', $excerpt, $matches))
{
return array(
'markup' => $matches[0],
'extent' => strlen($matches[0]),
);
}
}
protected function inlineCode($excerpt)