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:
parent
ce073c9baa
commit
535110c57e
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user