summaryrefslogtreecommitdiff
path: root/js/lib
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-01-13 20:38:58 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-01-13 20:38:58 -0800
commit95a60358a55014401ff16531ced05deb407bb66a (patch)
treef24bbd7de0f7710514977d661456abed420cc103 /js/lib
parent539b3c05cb0c4025f512c0c17cdf974909f5df02 (diff)
Assign marker_offset to list data at initialization.
Diffstat (limited to 'js/lib')
-rw-r--r--js/lib/blocks.js8
1 files changed, 4 insertions, 4 deletions
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