From eb704f552257042e264cc3d9c4dea974aa2b15e2 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 4 Feb 2015 21:40:53 +0000 Subject: Move list count increment to within li handler --- lib/writers/markdown-writer.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/writers/markdown-writer.js b/lib/writers/markdown-writer.js index eb3ada5..9f09e34 100644 --- a/lib/writers/markdown-writer.js +++ b/lib/writers/markdown-writer.js @@ -35,6 +35,7 @@ function markdownList(attributes, list) { } function markdownListItem(attributes, list) { + list.count++; var start = repeatString("\t", Math.max(list.indent, 0)) + (list.type === "ul" ? "-" : list.count + ".") + " "; @@ -83,10 +84,6 @@ function markdownWriter() { function open(tagName, attributes) { attributes = attributes || {}; - if (tagName === "li") { - list.count++; - } - var idHasBeenWritten = false; var createElement = htmlmarkdown[tagName] || function() { return {}; }; -- cgit v1.2.3