FIX: urls in BBCode tags weren't working

This commit is contained in:
Régis Hanol
2013-06-27 00:41:48 +02:00
parent b47f6e80b8
commit 689b296204
3 changed files with 70 additions and 18 deletions

View File

@ -77,7 +77,7 @@ test("Quotes", function() {
"<p>1</p><aside class='quote' data-post=\"1\" >\n <div class='title'>\n <div class='quote-controls'></div>\n" +
" \n bob\n said:\n </div>\n <blockquote>my quote</blockquote>\n</aside>\n<p> <br>\n2</p>",
"includes no avatar if none is found");
});
});
test("Mentions", function() {
cookedOptions("Hello @sam", { mentionLookup: (function() { return true; }) },
@ -120,9 +120,18 @@ test("SanitizeHTML", function() {
});
// TODO
// test("with BBCode", function() {
// cooked("[img]http://eviltrout.com/eviltrout.png[/img]",
// "<p><img src=\"http://eviltrout.com/eviltrout.png\"></p>",
// "BBCode is parsed first");
// });
test("URLs in BBCode tags", function() {
cooked("[img]http://eviltrout.com/eviltrout.png[/img][img]http://samsaffron.com/samsaffron.png[/img]",
"<p><img src=\"http://eviltrout.com/eviltrout.png\"><img src=\"http://samsaffron.com/samsaffron.png\"></p>",
"images are properly parsed");
cooked("[url]http://discourse.org[/url]",
"<p><a href=\"http://discourse.org\">http://discourse.org</a></p>",
"links are properly parsed");
cooked("[url=http://discourse.org]discourse[/url]",
"<p><a href=\"http://discourse.org\">discourse</a></p>",
"named links are properly parsed");
});