From e3cd271f1603134c31359043677fbc8c7dc8d1e5 Mon Sep 17 00:00:00 2001 From: Aidan Woods Date: Wed, 5 Oct 2016 15:44:34 +0100 Subject: [PATCH] Allow parsedown to specify list start attribute Performance: Swap preg_replace for stristr to obtain list start --- Parsedown.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Parsedown.php b/Parsedown.php index 9693428..03b729b 100644 --- a/Parsedown.php +++ b/Parsedown.php @@ -515,7 +515,7 @@ class Parsedown ); if($name === 'ol') { - $list_num = preg_replace ('/^([0-9]+)[.].*+$/', '$1', $matches[0]); + $list_num = stristr($matches[0], ".", true); if($list_num !== '1') { $Block['element']['attributes'] = array('start' => $list_num);