|
@ -5,7 +5,7 @@ |
|
|
var isSpace = require('../common/utils').isSpace; |
|
|
var isSpace = require('../common/utils').isSpace; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Search `[-+*][\n ]`, returns next pos arter marker on success
|
|
|
// Search `[-+*][\n ]`, returns next pos after marker on success
|
|
|
// or -1 on fail.
|
|
|
// or -1 on fail.
|
|
|
function skipBulletListMarker(state, startLine) { |
|
|
function skipBulletListMarker(state, startLine) { |
|
|
var marker, pos, max, ch; |
|
|
var marker, pos, max, ch; |
|
@ -33,7 +33,7 @@ function skipBulletListMarker(state, startLine) { |
|
|
return pos; |
|
|
return pos; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Search `\d+[.)][\n ]`, returns next pos arter marker on success
|
|
|
// Search `\d+[.)][\n ]`, returns next pos after marker on success
|
|
|
// or -1 on fail.
|
|
|
// or -1 on fail.
|
|
|
function skipOrderedListMarker(state, startLine) { |
|
|
function skipOrderedListMarker(state, startLine) { |
|
|
var ch, |
|
|
var ch, |
|
@ -210,12 +210,10 @@ module.exports = function list(state, startLine, endLine, silent) { |
|
|
while (pos < max) { |
|
|
while (pos < max) { |
|
|
ch = state.src.charCodeAt(pos); |
|
|
ch = state.src.charCodeAt(pos); |
|
|
|
|
|
|
|
|
if (isSpace(ch)) { |
|
|
|
|
|
if (ch === 0x09) { |
|
|
if (ch === 0x09) { |
|
|
offset += 4 - (offset + state.bsCount[nextLine]) % 4; |
|
|
offset += 4 - (offset + state.bsCount[nextLine]) % 4; |
|
|
} else { |
|
|
} else if (ch === 0x20) { |
|
|
offset++; |
|
|
offset++; |
|
|
} |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
@ -316,7 +314,7 @@ module.exports = function list(state, startLine, endLine, silent) { |
|
|
if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { break; } |
|
|
if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { break; } |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Finilize list
|
|
|
// Finalize list
|
|
|
if (isOrdered) { |
|
|
if (isOrdered) { |
|
|
token = state.push('ordered_list_close', 'ol', -1); |
|
|
token = state.push('ordered_list_close', 'ol', -1); |
|
|
} else { |
|
|
} else { |
|
|