mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
array_shift » unset to simplify code base and improve performance
This commit is contained in:
parent
b91629ad94
commit
a9d6232705
@ -432,7 +432,7 @@ class Parsedown
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# li
|
# li
|
||||||
|
|
||||||
if ($deindented_line[0] <= '9' and $deindented_line >= '0' and preg_match('/^([ ]*)\d+[.][ ](.*)/', $line, $matches))
|
if ($deindented_line[0] <= '9' and $deindented_line >= '0' and preg_match('/^([ ]*)\d+[.][ ](.*)/', $line, $matches))
|
||||||
{
|
{
|
||||||
@ -483,7 +483,7 @@ class Parsedown
|
|||||||
|
|
||||||
$elements []= $element;
|
$elements []= $element;
|
||||||
|
|
||||||
array_shift($elements);
|
unset($elements[0]);
|
||||||
|
|
||||||
#
|
#
|
||||||
# ~
|
# ~
|
||||||
@ -491,7 +491,7 @@ class Parsedown
|
|||||||
|
|
||||||
$markup = '';
|
$markup = '';
|
||||||
|
|
||||||
foreach ($elements as $index => $element)
|
foreach ($elements as $element)
|
||||||
{
|
{
|
||||||
switch ($element['type'])
|
switch ($element['type'])
|
||||||
{
|
{
|
||||||
@ -501,7 +501,7 @@ class Parsedown
|
|||||||
|
|
||||||
$text = preg_replace('/[ ]{2}\n/', '<br />'."\n", $text);
|
$text = preg_replace('/[ ]{2}\n/', '<br />'."\n", $text);
|
||||||
|
|
||||||
if ($context === 'li' and $index === 0)
|
if ($context === 'li' and $markup === '')
|
||||||
{
|
{
|
||||||
if (isset($element['interrupted']))
|
if (isset($element['interrupted']))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user