@ -161,7 +161,7 @@ module.exports = function list(state, startLine, endLine, silent) {
if ( ( posAfterMarker = skipOrderedListMarker ( state , startLine ) ) >= 0 ) {
if ( ( posAfterMarker = skipOrderedListMarker ( state , startLine ) ) >= 0 ) {
isOrdered = true ;
isOrdered = true ;
start = state . bMarks [ startLine ] + state . tShift [ startLine ] ;
start = state . bMarks [ startLine ] + state . tShift [ startLine ] ;
markerValue = Number ( state . src . substr ( start , posAfterMarker - start - 1 ) ) ;
markerValue = Number ( state . src . slice ( start , posAfterMarker - 1 ) ) ;
// If we're starting a new ordered list right after
// If we're starting a new ordered list right after
// a paragraph, it should start with 1.
// a paragraph, it should start with 1.
@ -254,6 +254,9 @@ module.exports = function list(state, startLine, endLine, silent) {
token = state . push ( 'list_item_open' , 'li' , 1 ) ;
token = state . push ( 'list_item_open' , 'li' , 1 ) ;
token . markup = String . fromCharCode ( markerCharCode ) ;
token . markup = String . fromCharCode ( markerCharCode ) ;
token . map = itemLines = [ startLine , 0 ] ;
token . map = itemLines = [ startLine , 0 ] ;
if ( isOrdered ) {
token . info = state . src . slice ( start , posAfterMarker - 1 ) ;
}
// change current state, then restore it after parser subcall
// change current state, then restore it after parser subcall
oldTight = state . tight ;
oldTight = state . tight ;
@ -330,6 +333,7 @@ module.exports = function list(state, startLine, endLine, silent) {
if ( isOrdered ) {
if ( isOrdered ) {
posAfterMarker = skipOrderedListMarker ( state , nextLine ) ;
posAfterMarker = skipOrderedListMarker ( state , nextLine ) ;
if ( posAfterMarker < 0 ) { break ; }
if ( posAfterMarker < 0 ) { break ; }
start = state . bMarks [ nextLine ] + state . tShift [ nextLine ] ;
} else {
} else {
posAfterMarker = skipBulletListMarker ( state , nextLine ) ;
posAfterMarker = skipBulletListMarker ( state , nextLine ) ;
if ( posAfterMarker < 0 ) { break ; }
if ( posAfterMarker < 0 ) { break ; }