1
0
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:
Aidan Woods 2018-04-06 18:10:41 +01:00
parent e33f1a48c8
commit 557db7c179
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9

View File

@ -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)