diff options
author | Aidan Woods <aidantwoods@gmail.com> | 2016-10-05 15:44:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-05 15:44:34 +0100 |
commit | e3cd271f1603134c31359043677fbc8c7dc8d1e5 (patch) | |
tree | a83216f6e5cdc0c9b7442c333257e22b8b2cd5fd | |
parent | f0b7b61c16c1abe25756518c764d6e84e9914b12 (diff) | |
download | parsedown-e3cd271f1603134c31359043677fbc8c7dc8d1e5.zip parsedown-e3cd271f1603134c31359043677fbc8c7dc8d1e5.tar.gz parsedown-e3cd271f1603134c31359043677fbc8c7dc8d1e5.tar.bz2 |
Allow parsedown to specify list start attribute
Performance: Swap preg_replace for stristr to obtain list start
-rw-r--r-- | Parsedown.php | 2 |
1 files changed, 1 insertions, 1 deletions
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); |