diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/writers/markdown-writer.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/writers/markdown-writer.js b/lib/writers/markdown-writer.js index 268b8fb..872db13 100644 --- a/lib/writers/markdown-writer.js +++ b/lib/writers/markdown-writer.js @@ -98,8 +98,6 @@ function markdownWriter() { function open(tagName, attributes) { attributes = attributes || {}; - var idHasBeenWritten = false; - var createElement = htmlToMarkdown[tagName] || function() { return {}; }; var element = createElement(attributes, list, listItem); elementStack.push({end: element.end, list: list}); @@ -108,13 +106,13 @@ function markdownWriter() { list = element.list; } - if (element.anchorPosition === "before") { + var anchorBeforeStart = element.anchorPosition === "before"; + if (anchorBeforeStart) { writeAnchor(attributes); - idHasBeenWritten = true; } fragments.push(element.start || ""); - if (!idHasBeenWritten) { + if (!anchorBeforeStart) { writeAnchor(attributes); } } |
