From f0b7b61c16c1abe25756518c764d6e84e9914b12 Mon Sep 17 00:00:00 2001 From: Aidan Woods Date: Wed, 5 Oct 2016 11:36:27 +0100 Subject: [PATCH] Allow parsedown to specify list start attribute Should fix compatibility for PHP 5.3 --- Parsedown.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Parsedown.php b/Parsedown.php index a9fa5ae..9693428 100644 --- a/Parsedown.php +++ b/Parsedown.php @@ -515,7 +515,7 @@ class Parsedown ); if($name === 'ol') { - $list_num = explode ('.', $matches[0], 2)[0]; + $list_num = preg_replace ('/^([0-9]+)[.].*+$/', '$1', $matches[0]); if($list_num !== '1') { $Block['element']['attributes'] = array('start' => $list_num);