Fix: whitelist regex for bbcode too wide

This commit is contained in:
Sam 2014-07-10 09:17:04 +10:00
parent a52c80e2a8
commit 9828a268b9
2 changed files with 6 additions and 2 deletions

View File

@ -258,6 +258,6 @@ Discourse.Markdown.whiteListTag('span', 'bbcode-i');
Discourse.Markdown.whiteListTag('span', 'bbcode-u'); Discourse.Markdown.whiteListTag('span', 'bbcode-u');
Discourse.Markdown.whiteListTag('span', 'bbcode-s'); Discourse.Markdown.whiteListTag('span', 'bbcode-s');
Discourse.Markdown.whiteListTag('span', 'class', /bbcode-size-\d+/); Discourse.Markdown.whiteListTag('span', 'class', /bbcode-size-\d+$/);
Discourse.Markdown.whiteListIframe(/^(https?:)?\/\/www\.google\.com\/maps\/embed\?.+/i); Discourse.Markdown.whiteListIframe(/^(https?:)?\/\/www\.google\.com\/maps\/embed\?.+/i);

View File

@ -240,8 +240,12 @@ describe PrettyText do
end end
end end
describe "markdown quirks" do describe "markdown quirks" do
it "sanitizes spans" do
PrettyText.cook("<span class=\"-bbcode-size-0 fa fa-spin\">a</span>").should match_html "<p><span>a</span></p>"
end
it "bolds stuff in parens" do it "bolds stuff in parens" do
PrettyText.cook("a \"**hello**\"").should match_html "<p>a &quot;<strong>hello</strong>&quot;</p>" PrettyText.cook("a \"**hello**\"").should match_html "<p>a &quot;<strong>hello</strong>&quot;</p>"
PrettyText.cook("(**hello**)").should match_html "<p>(<strong>hello</strong>)</p>" PrettyText.cook("(**hello**)").should match_html "<p>(<strong>hello</strong>)</p>"