1
0
mirror of https://github.com/erusev/parsedown.git synced 2025-09-02 19:32:35 +02:00

Avoid recomputation

This commit is contained in:
Aidan Woods
2018-04-08 22:32:42 +01:00
parent d4f1ac465c
commit 107223d3a0

View File

@@ -572,13 +572,15 @@ class Parsedown
$matches[1] .= ' ';
}
$markerWithoutWhitespace = strstr($matches[1], ' ', true);
$Block = array(
'indent' => $Line['indent'],
'pattern' => $pattern,
'data' => array(
'type' => $name,
'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(
'name' => $name,