mirror of
https://github.com/erusev/parsedown.git
synced 2024-09-20 03:51:29 +02:00
Allow parsedown to specify list start attribute
Performance: Swap preg_replace for stristr to obtain list start
This commit is contained in:
parent
f0b7b61c16
commit
e3cd271f16
@ -515,7 +515,7 @@ class Parsedown
|
|||||||
);
|
);
|
||||||
if($name === 'ol')
|
if($name === 'ol')
|
||||||
{
|
{
|
||||||
$list_num = preg_replace ('/^([0-9]+)[.].*+$/', '$1', $matches[0]);
|
$list_num = stristr($matches[0], ".", true);
|
||||||
if($list_num !== '1')
|
if($list_num !== '1')
|
||||||
{
|
{
|
||||||
$Block['element']['attributes'] = array('start' => $list_num);
|
$Block['element']['attributes'] = array('start' => $list_num);
|
||||||
|
Loading…
Reference in New Issue
Block a user