1
0
mirror of https://github.com/erusev/parsedown.git synced 2025-09-03 03:42:38 +02:00

Merge pull request #593 from aidantwoods/enhancement/process

Decouple manipulating final AST from `text` method
This commit is contained in:
Aidan Woods
2018-04-01 16:37:44 +01:00
committed by GitHub

View File

@@ -36,7 +36,13 @@ class Parsedown
$lines = explode("\n", $text);
# 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
$markup = trim($markup, "\n");
@@ -1709,6 +1715,11 @@ class Parsedown
return $markup;
}
protected function process(array $Elements)
{
return $Elements;
}
# ~
protected function li($lines)