From b142a396090798ed06e89475dcf6fd77362e312f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 22 Nov 2014 20:10:47 -0800 Subject: Fixed #214 C and JS implementations. They were gobbling whitespace after shortcut reference links, e.g. [foo] bar [foo]: url Closes #214. --- js/lib/inlines.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'js') diff --git a/js/lib/inlines.js b/js/lib/inlines.js index 1f4d194..96e8753 100644 --- a/js/lib/inlines.js +++ b/js/lib/inlines.js @@ -575,6 +575,10 @@ var parseCloseBracket = function(inlines) { } else { reflabel = this.subject.slice(beforelabel, beforelabel + n); } + if (n === 0) { + // If shortcut reference link, rewind before spaces we skipped. + this.pos = savepos; + } // lookup rawlabel in refmap var link = this.refmap[normalizeReference(reflabel)]; -- cgit v1.2.3