FIX: New line after blockquote

This commit is contained in:
Robin Ward 2013-10-16 10:26:35 -04:00
parent f27413219e
commit 67771d6bdf
2 changed files with 9 additions and 3 deletions
app/assets/javascripts/discourse/dialects
test/javascripts/components

View file

@ -321,7 +321,7 @@ Discourse.Dialect = {
if (endFound !== -1) {
if (trailingContents) {
next.unshift(MD.mk_block(trailingContents));
next.unshift(MD.mk_block(trailingContents.replace(/^\s+/, "")));
}
blockContents.push(leadingContents.replace(/\s+$/, ""));
@ -332,8 +332,6 @@ Discourse.Dialect = {
}
var emitterResult = args.emitter.call(this, blockContents, m, dialect.options);
if (emitterResult) {
result.push(emitterResult);

View file

@ -95,4 +95,12 @@ test("quote formatting", function() {
});
test("quotes with trailing formatting", function() {
var cooked = Discourse.Markdown.cook("[quote=\"EvilTrout, post:123, topic:456, full:true\"]\nhello\n[/quote]\n*Test*", {lookupAvatar: false});
equal(cooked,
"<p><aside class=\"quote\" data-post=\"123\" data-topic=\"456\" data-full=\"true\"><div class=\"title\">" +
"<div class=\"quote-controls\"></div>EvilTrout said:</div><blockquote><p>hello</p></blockquote></aside></p>\n\n<p><em>Test</em></p>",
"it allows trailing formatting");
});