From 535110c57eae6227a80074ed60378260cb966276 Mon Sep 17 00:00:00 2001 From: Aidan Woods Date: Sat, 31 Mar 2018 23:23:12 +0100 Subject: [PATCH] Add `process` method so extensions may process final AST without copying implementation of `text` --- Parsedown.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Parsedown.php b/Parsedown.php index 8b6ebc9..382023c 100644 --- a/Parsedown.php +++ b/Parsedown.php @@ -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)