Skip to content

Commit ae93fce

Browse files
committed
FIX: Autolines were duplicating some text
1 parent a375701 commit ae93fce

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

app/assets/javascripts/discourse/dialects/autolink_dialect.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Discourse.Dialect.on("register", function(event) {
4949

5050
if (remaining && remaining.match(/\n/)) {
5151
next.unshift(MD.mk_block(remaining));
52+
remaining = [];
5253
}
5354
}
5455

test/javascripts/components/markdown_test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ test("Links", function() {
6262
'<p>EvilTrout: <a href="http://eviltrout.com">http://eviltrout.com</a></p>',
6363
"autolinks a URL");
6464

65+
cooked("EvilTrout: http://eviltrout.com hello",
66+
'<p>EvilTrout: <a href="http://eviltrout.com">http://eviltrout.com</a> hello</p>',
67+
"autolinks with trailing text");
68+
6569
cooked("here is [an example](http://twitter.com)",
6670
'<p>here is <a href="http://twitter.com">an example</a></p>',
6771
"supports markdown style links");

0 commit comments

Comments
 (0)