mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
resolve #209
This commit is contained in:
parent
2adb87ef41
commit
da5d75e97e
@ -649,7 +649,7 @@ class Parsedown
|
|||||||
'element' => $Line['body'],
|
'element' => $Line['body'],
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($matches[2] or $matches[1] === 'hr' or preg_match('/<\/'.$matches[1].'>[ ]*$/', $Line['text']))
|
if ($matches[2] or in_array($matches[1], $this->voidElements) or preg_match('/<\/'.$matches[1].'>[ ]*$/', $Line['text']))
|
||||||
{
|
{
|
||||||
$Block['closed'] = true;
|
$Block['closed'] = true;
|
||||||
}
|
}
|
||||||
@ -1412,6 +1412,10 @@ class Parsedown
|
|||||||
'_' => '/^_((?:[^_]|__[^_]*__)+?)_(?!_)\b/us',
|
'_' => '/^_((?:[^_]|__[^_]*__)+?)_(?!_)\b/us',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
protected $voidElements = array(
|
||||||
|
'area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source',
|
||||||
|
);
|
||||||
|
|
||||||
protected $textLevelElements = array(
|
protected $textLevelElements = array(
|
||||||
'a', 'br', 'bdo', 'abbr', 'blink', 'nextid', 'acronym', 'basefont',
|
'a', 'br', 'bdo', 'abbr', 'blink', 'nextid', 'acronym', 'basefont',
|
||||||
'b', 'em', 'big', 'cite', 'small', 'spacer', 'listing',
|
'b', 'em', 'big', 'cite', 'small', 'spacer', 'listing',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user