From 557db7c1799c1955e442d9a6c18fb8bc259a8501 Mon Sep 17 00:00:00 2001 From: Aidan Woods Date: Fri, 6 Apr 2018 18:10:41 +0100 Subject: [PATCH] Split some of `text` into `textElements` `process` is no longer needed --- Parsedown.php | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/Parsedown.php b/Parsedown.php index 186896c..a6297dc 100755 --- a/Parsedown.php +++ b/Parsedown.php @@ -22,6 +22,19 @@ class Parsedown # ~ function text($text) + { + $Elements = $this->textElements($text); + + # convert to markup + $markup = $this->elements($Elements); + + # trim line breaks + $markup = trim($markup, "\n"); + + return $markup; + } + + protected function textElements($text) { # make sure no definitions are set $this->DefinitionData = array(); @@ -36,18 +49,7 @@ class Parsedown $lines = explode("\n", $text); # iterate through lines to identify blocks - $Elements = $this->linesElements($lines); - - # process elements - $Elements = $this->process($Elements); - - # convert to markup - $markup = $this->elements($Elements); - - # trim line breaks - $markup = trim($markup, "\n"); - - return $markup; + return $this->linesElements($lines); } # @@ -1743,11 +1745,6 @@ class Parsedown return $markup; } - protected function process(array $Elements) - { - return $Elements; - } - # ~ protected function li($lines)