FIX: BBCode with params couldn't span lines

This commit is contained in:
Robin Ward 2014-08-22 12:14:10 -04:00
parent f422e5c8c4
commit 104b39540a
2 changed files with 4 additions and 1 deletions

View File

@ -47,7 +47,7 @@ function replaceBBCodeParamsRaw(tag, emitter) {
stop: "[/" + tag + "]",
rawContents: true,
emitter: function(contents) {
var regexp = /^([^\]]+)\](.*)$/,
var regexp = /^([^\]]+)\]([\S\s]*)$/,
m = regexp.exec(contents);
if (m) { return emitter.call(this, m[1], m[2]); }

View File

@ -62,6 +62,9 @@ test("size tags", function() {
format("[size=asdf]regular[/size]",
"<span class=\"bbcode-size-1\">regular</span>",
"it only supports numbers in bbcode");
format("[size=35]\nNEWLINE\n[/size]",
"<span class=\"bbcode-size-35\"><br>NEWLINE<br></span>",
"works with newlines");
});
test("quotes", function() {