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