mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Implement Markup
This commit is contained in:
@ -334,45 +334,6 @@ class Parsedown
|
||||
return $Block;
|
||||
}
|
||||
|
||||
#
|
||||
# Markup
|
||||
|
||||
protected function blockMarkup(Context $Context)
|
||||
{
|
||||
if ($this->markupEscaped or $this->safeMode) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (\preg_match('/^<[\/]?+(\w*)(?:[ ]*+'.$this->regexHtmlAttribute.')*+[ ]*+(\/)?>/', $Context->line()->text(), $matches)) {
|
||||
$element = \strtolower($matches[1]);
|
||||
|
||||
if (\in_array($element, $this->textLevelElements, true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$Block = [
|
||||
'name' => $matches[1],
|
||||
'element' => [
|
||||
'rawHtml' => $Context->line()->text(),
|
||||
'autobreak' => true,
|
||||
],
|
||||
];
|
||||
|
||||
return $Block;
|
||||
}
|
||||
}
|
||||
|
||||
protected function blockMarkupContinue(Context $Context, array $Block)
|
||||
{
|
||||
if (isset($Block['closed']) or $Context->previousEmptyLines() > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$Block['element']['rawHtml'] .= "\n" . $Context->line()->rawLine();
|
||||
|
||||
return $Block;
|
||||
}
|
||||
|
||||
#
|
||||
# Reference
|
||||
|
||||
|
Reference in New Issue
Block a user