diff --git a/Parsedown.php b/Parsedown.php index 646af86..4737eee 100644 --- a/Parsedown.php +++ b/Parsedown.php @@ -515,6 +515,16 @@ class Parsedown ), ); + if($name === 'ol') + { + $listStart = stristr($matches[0], '.', true); + + if($listStart !== '1') + { + $Block['element']['attributes'] = array('start' => $listStart); + } + } + $Block['li'] = array( 'name' => 'li', 'handler' => 'li', diff --git a/test/data/ordered_list.html b/test/data/ordered_list.html index b6c5216..c4a69db 100644 --- a/test/data/ordered_list.html +++ b/test/data/ordered_list.html @@ -8,6 +8,6 @@
  • two
  • large numbers:

    -
      +
      1. one
      \ No newline at end of file