1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

Add process method so extensions may process final AST without

copying implementation of `text`
This commit is contained in:
Aidan Woods 2018-03-31 23:23:12 +01:00
parent ce073c9baa
commit 535110c57e
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9

View File

@ -36,7 +36,13 @@ class Parsedown
$lines = explode("\n", $text); $lines = explode("\n", $text);
# iterate through lines to identify blocks # iterate through lines to identify blocks
$markup = $this->lines($lines); $Elements = $this->linesElements($lines);
# process elements
$Elements = $this->process($Elements);
# convert to markup
$markup = $this->elements($Elements);
# trim line breaks # trim line breaks
$markup = trim($markup, "\n"); $markup = trim($markup, "\n");
@ -1709,6 +1715,11 @@ class Parsedown
return $markup; return $markup;
} }
protected function process(array $Elements)
{
return $Elements;
}
# ~ # ~
protected function li($lines) protected function li($lines)