diff --git a/app/assets/javascripts/discourse/dialects/bbcode_dialect.js b/app/assets/javascripts/discourse/dialects/bbcode_dialect.js index c2ccdad760a..41d2b534743 100644 --- a/app/assets/javascripts/discourse/dialects/bbcode_dialect.js +++ b/app/assets/javascripts/discourse/dialects/bbcode_dialect.js @@ -55,7 +55,7 @@ Discourse.BBCode.register = function(codeName, args, emitter) { } }); } - if (!args.singlePara && contents.length === 1) { + if (!args.singlePara && contents.length === 1 && contents[0] instanceof Array && contents[0][0] === "para") { contents[0].shift(); contents = contents[0]; } diff --git a/test/javascripts/lib/bbcode-test.js.es6 b/test/javascripts/lib/bbcode-test.js.es6 index 84e60c90fec..f739e2b74ee 100644 --- a/test/javascripts/lib/bbcode-test.js.es6 +++ b/test/javascripts/lib/bbcode-test.js.es6 @@ -65,6 +65,9 @@ test("size tags", function() { format("[size=35]NEWLINE\n\ntest[/size]", "

NEWLINE

test

", "works with newlines"); + format("[size=35][quote=\"user\"]quote[/quote][/size]", + "", + "works with nested complex blocks"); }); test("quotes", function() {