diff --git a/lib/inlines.js b/lib/inlines.js index dd30bd4f..1ecf8eef 100644 --- a/lib/inlines.js +++ b/lib/inlines.js @@ -884,7 +884,6 @@ var parseReference = function(s, refmap) { title = this.parseLinkTitle(); } if (title === null) { - title = ""; // rewind before spaces this.pos = beforetitle; } @@ -892,13 +891,13 @@ var parseReference = function(s, refmap) { // make sure we're at line end: var atLineEnd = true; if (this.match(reSpaceAtEndOfLine) === null) { - if (title === "") { + if (title === null) { atLineEnd = false; } else { // the potential title we found is not at the line end, // but it could still be a legal link reference if we // discard the title - title = ""; + title = null; // rewind before spaces this.pos = beforetitle; // and instead check if the link URL is at the line end @@ -919,7 +918,7 @@ var parseReference = function(s, refmap) { } if (!refmap[normlabel]) { - refmap[normlabel] = { destination: dest, title: title }; + refmap[normlabel] = { destination: dest, title: title === null ? "" : title }; } return this.pos - startpos; }; diff --git a/test/regression.txt b/test/regression.txt index da235fb2..aea81378 100644 --- a/test/regression.txt +++ b/test/regression.txt @@ -484,3 +484,11 @@ x <- 1

&para

ΒΆ

```````````````````````````````` + +#281 +```````````````````````````````` example +[test]:example +""third [test] +. +

""third test

+```````````````````````````````` \ No newline at end of file