From 686999863864679ac25016574a9b064a4498fb1f Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Tue, 17 Apr 2018 13:27:18 -0500 Subject: [PATCH] set title to empty string --- lib/marked.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index eb8faefc8f..1fe8ba45ac 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -709,12 +709,13 @@ InlineLexer.prototype.output = function(src) { if (link) { href = link[1]; title = link[3]; + } else { + title = ''; } - href = href.trim(); } else { - title = cap[3] ? cap[3].slice(1, -1) : cap[3]; + title = cap[3] ? cap[3].slice(1, -1) : ''; } - href = href.replace(/^<([\s\S]*)>$/, '$1'); + href = href.trim().replace(/^<([\s\S]*)>$/, '$1'); out += this.outputLink(cap, { href: InlineLexer.escapes(href), title: InlineLexer.escapes(title)