mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 09:57:25 +08:00
FIX: urls in BBCode tags weren't working
This commit is contained in:
@ -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");
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user