1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03: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
commit 68736f8800
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)