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)
|
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
|
# make sure no definitions are set
|
||||||
$this->DefinitionData = array();
|
$this->DefinitionData = array();
|
||||||
@ -36,18 +49,7 @@ class Parsedown
|
|||||||
$lines = explode("\n", $text);
|
$lines = explode("\n", $text);
|
||||||
|
|
||||||
# iterate through lines to identify blocks
|
# iterate through lines to identify blocks
|
||||||
$Elements = $this->linesElements($lines);
|
return $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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -1763,11 +1765,6 @@ class Parsedown
|
|||||||
return $markup;
|
return $markup;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function process(array $Elements)
|
|
||||||
{
|
|
||||||
return $Elements;
|
|
||||||
}
|
|
||||||
|
|
||||||
# ~
|
# ~
|
||||||
|
|
||||||
protected function li($lines)
|
protected function li($lines)
|
||||||
|
Loading…
Reference in New Issue
Block a user