mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 05:50:14 +08:00
Merge pull request #2811 from Elberet/fix-bbcode-blocks
FIX: BBCode blocks parser no longer mangles JsonML arrays
This commit is contained in:
commit
fd5dde4ab5
|
@ -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];
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user