diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-02-04 21:40:53 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-02-04 21:40:53 +0000 |
| commit | eb704f552257042e264cc3d9c4dea974aa2b15e2 (patch) | |
| tree | f6ddb5338657e8514f7f5adaa1d322402a9b1247 /lib/writers | |
| parent | c5d83a17321e0813a8f3a43317f52ed86e183154 (diff) | |
Move list count increment to within li handler
Diffstat (limited to 'lib/writers')
| -rw-r--r-- | lib/writers/markdown-writer.js | 5 |
1 files changed, 1 insertions, 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 {}; }; |
