diff --git a/test/javascripts/lib/markdown-test.js.es6 b/test/javascripts/lib/markdown-test.js.es6 index 72203067e38..7c6cf4e4080 100644 --- a/test/javascripts/lib/markdown-test.js.es6 +++ b/test/javascripts/lib/markdown-test.js.es6 @@ -150,6 +150,10 @@ test("Links", function() { cooked("[Link](http://www.example.com) (with an outer \"description\")", "

Link (with an outer \"description\")

", "it doesn't consume closing parens as part of the url"); + + cooked("[ul][1]\n\n[1]: http://eviltrout.com", + "

ul

", + "it can use `ul` as a link name"); }); test("simple quotes", function() { diff --git a/vendor/assets/javascripts/better_markdown.js b/vendor/assets/javascripts/better_markdown.js index f8494d9e83e..f01451ec283 100644 --- a/vendor/assets/javascripts/better_markdown.js +++ b/vendor/assets/javascripts/better_markdown.js @@ -1186,15 +1186,14 @@ this, text.substr( m.index ), m, previous_nodes || [] ); - if(!res){ - // fallback + // If no inline code executed, fallback + if (!res) { var fn = this.dialect.inline[m[1][0]]; - if(fn) { + if (fn) { res = fn.call( this, text.substr( m.index ), m, previous_nodes || [] ); } - } } // Default for now to make dev easier. just slurp special and output it.