|
|
@ -147,7 +147,6 @@ module.exports = function list(state, startLine, endLine, silent) { |
|
|
|
if (isOrdered) { |
|
|
|
start = state.bMarks[startLine] + state.tShift[startLine]; |
|
|
|
markerValue = Number(state.src.substr(start, posAfterMarker - start - 1)); |
|
|
|
|
|
|
|
token = state.push('ordered_list_open', 'ol', 1); |
|
|
|
if (markerValue !== 1) { |
|
|
|
token.attrs = [ [ 'start', markerValue ] ]; |
|
|
@ -168,6 +167,9 @@ module.exports = function list(state, startLine, endLine, silent) { |
|
|
|
prevEmptyEnd = false; |
|
|
|
terminatorRules = state.md.block.ruler.getRules('list'); |
|
|
|
|
|
|
|
oldParentType = state.parentType; |
|
|
|
state.parentType = 'list'; |
|
|
|
|
|
|
|
while (nextLine < endLine) { |
|
|
|
pos = posAfterMarker; |
|
|
|
max = state.eMarks[nextLine]; |
|
|
@ -216,10 +218,8 @@ module.exports = function list(state, startLine, endLine, silent) { |
|
|
|
oldTight = state.tight; |
|
|
|
oldTShift = state.tShift[startLine]; |
|
|
|
oldLIndent = state.sCount[startLine]; |
|
|
|
oldParentType = state.parentType; |
|
|
|
state.blkIndent = indent; |
|
|
|
state.tight = true; |
|
|
|
state.parentType = 'list'; |
|
|
|
state.tShift[startLine] = contentStart - state.bMarks[startLine]; |
|
|
|
state.sCount[startLine] = offset; |
|
|
|
|
|
|
@ -248,7 +248,6 @@ module.exports = function list(state, startLine, endLine, silent) { |
|
|
|
state.tShift[startLine] = oldTShift; |
|
|
|
state.sCount[startLine] = oldLIndent; |
|
|
|
state.tight = oldTight; |
|
|
|
state.parentType = oldParentType; |
|
|
|
|
|
|
|
token = state.push('list_item_close', 'li', -1); |
|
|
|
token.markup = String.fromCharCode(markerCharCode); |
|
|
@ -259,10 +258,6 @@ module.exports = function list(state, startLine, endLine, silent) { |
|
|
|
|
|
|
|
if (nextLine >= endLine) { break; } |
|
|
|
|
|
|
|
if (state.isEmpty(nextLine)) { |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
//
|
|
|
|
// Try to check if list is terminated or continued.
|
|
|
|
//
|
|
|
@ -301,6 +296,8 @@ module.exports = function list(state, startLine, endLine, silent) { |
|
|
|
listLines[1] = nextLine; |
|
|
|
state.line = nextLine; |
|
|
|
|
|
|
|
state.parentType = oldParentType; |
|
|
|
|
|
|
|
// mark paragraphs tight if needed
|
|
|
|
if (tight) { |
|
|
|
markTightParagraphs(state, listTokIdx); |
|
|
|