From deee500761d499d4ea50d3e75b1f626268879527 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 8 Feb 2015 20:22:55 +0000 Subject: Ignore anchor tags if href is not set --- lib/writers/markdown-writer.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/writers/markdown-writer.js b/lib/writers/markdown-writer.js index 5908e3b..268b8fb 100644 --- a/lib/writers/markdown-writer.js +++ b/lib/writers/markdown-writer.js @@ -13,11 +13,15 @@ function markdownElement(start, end) { function markdownLink(attributes) { var href = attributes.href || ""; - return { - start: "[", - end: "](" + href + ")", - anchorPosition: "before" - }; + if (href) { + return { + start: "[", + end: "](" + href + ")", + anchorPosition: "before" + }; + } else { + return {}; + } } function markdownImage(attributes) { -- cgit v1.2.3