From 95a60358a55014401ff16531ced05deb407bb66a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 13 Jan 2015 20:38:58 -0800 Subject: Assign marker_offset to list data at initialization. --- js/lib/blocks.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'js') diff --git a/js/lib/blocks.js b/js/lib/blocks.js index e7f37a7..a9e7f53 100644 --- a/js/lib/blocks.js +++ b/js/lib/blocks.js @@ -169,7 +169,7 @@ var addChild = function(tag, offset) { // Parse a list marker and return data on the marker (type, // start, delimiter, bullet character, padding) or null. -var parseListMarker = function(ln, offset) { +var parseListMarker = function(ln, offset, indent) { var rest = ln.slice(offset); var match; var spaces_after_marker; @@ -178,7 +178,8 @@ var parseListMarker = function(ln, offset) { bullet_char: undefined, start: undefined, delimiter: undefined, - padding: undefined }; + padding: undefined, + marker_offset: indent }; if (rest.match(reHrule)) { return null; } @@ -437,10 +438,9 @@ var incorporateLine = function(ln) { offset = ln.length - 1; break; - } else if ((data = parseListMarker(ln, first_nonspace))) { + } else if ((data = parseListMarker(ln, first_nonspace, indent))) { // list item allClosed = allClosed || this.closeUnmatchedBlocks(); - data.marker_offset = indent; offset = first_nonspace + data.padding; // add the list if needed -- cgit v1.2.3