mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Split some of text
into textElements
`process` is no longer needed
This commit is contained in:
parent
e33f1a48c8
commit
557db7c179
@ -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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -1743,11 +1745,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