mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Fix ordered list start argument
See CommonMark spec examples [#226](http://spec.commonmark.org/0.26/#example-226) to #229
This commit is contained in:
parent
81025cd468
commit
bdf537e9d5
@ -502,7 +502,7 @@ class Parsedown
|
|||||||
|
|
||||||
protected function blockList($Line)
|
protected function blockList($Line)
|
||||||
{
|
{
|
||||||
list($name, $pattern) = $Line['text'][0] <= '-' ? array('ul', '[*+-]') : array('ol', '[0-9]+[.\)]');
|
list($name, $pattern) = $Line['text'][0] <= '-' ? array('ul', '[*+-]') : array('ol', '[0-9]{1,9}[.\)]');
|
||||||
|
|
||||||
if (preg_match('/^('.$pattern.'[ ]+)(.*)/', $Line['text'], $matches))
|
if (preg_match('/^('.$pattern.'[ ]+)(.*)/', $Line['text'], $matches))
|
||||||
{
|
{
|
||||||
@ -521,7 +521,7 @@ class Parsedown
|
|||||||
|
|
||||||
if($name === 'ol')
|
if($name === 'ol')
|
||||||
{
|
{
|
||||||
$listStart = stristr($matches[1], $Block['data']['marker'], true);
|
$listStart = ltrim(strstr($matches[1], $Block['data']['marker'], true), '0') ?: '0';
|
||||||
|
|
||||||
if($listStart !== '1')
|
if($listStart !== '1')
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user