FIX: Autolines were duplicating some text

This commit is contained in:
Robin Ward 2013-08-21 22:49:55 -04:00
parent a3757016d9
commit ae93fcebde
2 changed files with 5 additions and 0 deletions

View File

@ -49,6 +49,7 @@ Discourse.Dialect.on("register", function(event) {
if (remaining && remaining.match(/\n/)) {
next.unshift(MD.mk_block(remaining));
remaining = [];
}
}

View File

@ -62,6 +62,10 @@ test("Links", function() {
'<p>EvilTrout: <a href="http://eviltrout.com">http://eviltrout.com</a></p>',
"autolinks a URL");
cooked("EvilTrout: http://eviltrout.com hello",
'<p>EvilTrout: <a href="http://eviltrout.com">http://eviltrout.com</a> hello</p>',
"autolinks with trailing text");
cooked("here is [an example](http://twitter.com)",
'<p>here is <a href="http://twitter.com">an example</a></p>',
"supports markdown style links");