diff --git a/spec/components/pretty_text_spec.rb b/spec/components/pretty_text_spec.rb index 3dc0e9fbb43..594257ef3cc 100644 --- a/spec/components/pretty_text_spec.rb +++ b/spec/components/pretty_text_spec.rb @@ -266,43 +266,4 @@ describe PrettyText do end end - describe "markdown quirks" do - - it "sanitizes spans" do - PrettyText.cook("a").should match_html "
a
" - PrettyText.cook("a").should match_html "a
" - 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)
" - # is it me your looking for? - end - it "allows for newline after bold" do - PrettyText.cook("**hello**\nworld").should match_html "hello
world
hello
world
a*_b
" - end - - it "does not apply italics when there is a space inside" do - PrettyText.cook("** hello**").should match_html "** hello**
" - PrettyText.cook("**hello **").should match_html "**hello **
" - end - - it "allows does not bold chinese intra word" do - PrettyText.cook("你**hello**").should match_html "你**hello**
" - end - - it "allows bold chinese" do - PrettyText.cook("**你hello**").should match_html "你hello
" - end - - end - end diff --git a/test/javascripts/lib/markdown_test.js b/test/javascripts/lib/markdown_test.js index 7a961900b71..2182dfe56e0 100644 --- a/test/javascripts/lib/markdown_test.js +++ b/test/javascripts/lib/markdown_test.js @@ -261,9 +261,19 @@ test("Mentions", function() { test("Heading", function() { - cooked("**Bold**\n----------", - "a \"hello\"
", "bolds in quotes"); + cooked("(**hello**)", "(hello)
", "bolds in parens"); + cooked("**hello**\nworld", "hello
world
hello
world
a*_b
", "allows for characters within bold"); + cooked("** hello**", "** hello**
", "does not bold on a space boundary"); + cooked("**hello **", "**hello **
", "does not bold on a space boundary"); + cooked("你**hello**", "你**hello**
", "does not bold chinese intra word"); + cooked("**你hello**", "你hello
", "allows bolded chinese"); }); test("Oneboxing", function() { @@ -388,6 +398,10 @@ test("sanitize", function() { cooked("[the answer](javascript:alert(42))", "", "it prevents XSS"); cooked("\n", "a
", "it sanitizes spans"); + cooked("a", "a
", "it sanitizes spans"); + cooked("a", "a
", "it sanitizes spans"); }); test("URLs in BBCode tags", function() {