1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

Avoid recomputation

This commit is contained in:
Aidan Woods 2018-04-08 22:32:42 +01:00
parent d4f1ac465c
commit 107223d3a0
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9

View File

@ -572,13 +572,15 @@ class Parsedown
$matches[1] .= ' '; $matches[1] .= ' ';
} }
$markerWithoutWhitespace = strstr($matches[1], ' ', true);
$Block = array( $Block = array(
'indent' => $Line['indent'], 'indent' => $Line['indent'],
'pattern' => $pattern, 'pattern' => $pattern,
'data' => array( 'data' => array(
'type' => $name, 'type' => $name,
'marker' => $matches[1], 'marker' => $matches[1],
'markerType' => ($name === 'ul' ? strstr($matches[1], ' ', true) : substr(strstr($matches[1], ' ', true), -1)), 'markerType' => ($name === 'ul' ? $markerWithoutWhitespace : substr($markerWithoutWhitespace, -1)),
), ),
'element' => array( 'element' => array(
'name' => $name, 'name' => $name,