@@ -417,17 +417,18 @@ class Parser
417417
418418 if !! (matches = line .match / ^ (\s * )((?:[0-9 ] + \. )| \- | \+ | \* )\s + / i )
419419 space = matches[1 ].length
420+ tab = matches[0 ].length - space
420421 state .empty = 0
421422 type = if 0 <= ' +-*' .indexOf matches[2 ] then ' ul' else ' ol'
422423
423424 # opened
424425 if @ isBlock ' list'
425426 if space < block[3 ][0 ] or (space == block[3 ][0 ] and type != block[3 ][1 ])
426- @ startBlock ' list' , key, [space, type]
427+ @ startBlock ' list' , key, [space, type, tab ]
427428 else
428429 @ setBlock key
429430 else
430- @ startBlock ' list' , key, [space, type]
431+ @ startBlock ' list' , key, [space, type, tab ]
431432
432433 return no
433434
@@ -832,7 +833,7 @@ class Parser
832833
833834 parseList : (lines , value , start ) ->
834835 html = ' '
835- [space , type ] = value
836+ [space , type , tab ] = value
836837 rows = []
837838 suffix = ' '
838839 last = 0
@@ -847,7 +848,7 @@ class Parser
847848 rows .push [matches[4 ]]
848849 last = rows .length - 1
849850 else
850- rows[last].push line .replace (new RegExp " ^\\ s{#{ space} }" ), ' '
851+ rows[last].push line .replace (new RegExp " ^\\ s{#{ tab + space} }" ), ' '
851852
852853 for row in rows
853854 html += ' <li>' + (@parse (row .join " \n " ), yes , start) + ' </li>'
0 commit comments