1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

Merge pull request #602 from aidantwoods/enhancement/text-elements

Split some of `text` into `textElements`
This commit is contained in:
Aidan Woods 2018-04-06 19:50:24 +01:00 committed by GitHub
commit 201299ddc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}
#
@ -1763,11 +1765,6 @@ class Parsedown
return $markup;
}
protected function process(array $Elements)
{
return $Elements;
}
# ~
protected function li($lines)