diff --git a/app/assets/javascripts/discourse/lib/markdown.js b/app/assets/javascripts/discourse/lib/markdown.js index f1ac20bde71..a3068fb148d 100644 --- a/app/assets/javascripts/discourse/lib/markdown.js +++ b/app/assets/javascripts/discourse/lib/markdown.js @@ -258,6 +258,6 @@ Discourse.Markdown.whiteListTag('span', 'bbcode-i'); Discourse.Markdown.whiteListTag('span', 'bbcode-u'); 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); diff --git a/spec/components/pretty_text_spec.rb b/spec/components/pretty_text_spec.rb index df9e2e15d50..c418a45b760 100644 --- a/spec/components/pretty_text_spec.rb +++ b/spec/components/pretty_text_spec.rb @@ -240,8 +240,12 @@ describe PrettyText do end end - describe "markdown quirks" do + + it "sanitizes spans" do + PrettyText.cook("a").should match_html "
a
" + end + it "bolds stuff in parens" do PrettyText.cook("a \"**hello**\"").should match_html "a "hello"
" PrettyText.cook("(**hello**)").should match_html "(hello)
"