mirror of
https://github.com/erusev/parsedown.git
synced 2025-09-02 19:32:35 +02:00
Use non-nestable values as keys for O(1) lookup
This commit is contained in:
@@ -1114,6 +1114,8 @@ class Parsedown
|
||||
{
|
||||
$Elements = array();
|
||||
|
||||
$nonNestables = array_combine($nonNestables, $nonNestables);
|
||||
|
||||
# $excerpt is based on the first occurrence of a marker
|
||||
|
||||
while ($excerpt = strpbrk($text, $this->inlineMarkerList))
|
||||
@@ -1128,7 +1130,7 @@ class Parsedown
|
||||
{
|
||||
# check to see if the current inline type is nestable in the current context
|
||||
|
||||
if ( ! empty($nonNestables) and in_array($inlineType, $nonNestables))
|
||||
if (isset($nonNestables[$inlineType]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user