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:
commit
201299ddc2
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user