Merge pull request #2811 from Elberet/fix-bbcode-blocks

FIX: BBCode blocks parser no longer mangles JsonML arrays
This commit is contained in:
Sam 2014-09-22 12:01:09 +10:00
commit fd5dde4ab5
2 changed files with 4 additions and 1 deletions

View File

@ -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];
}

View File

@ -65,6 +65,9 @@ test("size tags", function() {
format("[size=35]NEWLINE\n\ntest[/size]",
"<span class=\"bbcode-size-35\"><p>NEWLINE</p><p>test</p></span>",
"works with newlines");
format("[size=35][quote=\"user\"]quote[/quote][/size]",
"<span class=\"bbcode-size-35\"><aside class=\"quote\"><div class=\"title\"><div class=\"quote-controls\"></div>user:</div><blockquote><p>quote</p></blockquote></aside></span>",
"works with nested complex blocks");
});
test("quotes", function() {