diff --git a/app/assets/javascripts/discourse/dialects/bold_italics_dialect.js b/app/assets/javascripts/discourse/dialects/bold_italics_dialect.js index bef903c186e..3c35b3b777f 100644 --- a/app/assets/javascripts/discourse/dialects/bold_italics_dialect.js +++ b/app/assets/javascripts/discourse/dialects/bold_italics_dialect.js @@ -7,14 +7,12 @@ Discourse.Dialect.inlineBetween({ between: '***', wordBoundary: true, - spaceBoundary: true, emitter: function(contents) { return ['strong', ['em'].concat(contents)]; } }); Discourse.Dialect.inlineBetween({ between: '___', wordBoundary: true, - spaceBoundary: true, emitter: function(contents) { return ['strong', ['em'].concat(contents)]; } }); @@ -23,7 +21,6 @@ var replaceMarkdown = function(match, tag) { Discourse.Dialect.inlineBetween({ between: match, wordBoundary: true, - spaceBoundary: true, emitter: function(contents) { return [tag].concat(contents) } }); }; diff --git a/app/assets/javascripts/discourse/dialects/dialect.js b/app/assets/javascripts/discourse/dialects/dialect.js index 2ed99d769aa..040e11028dd 100644 --- a/app/assets/javascripts/discourse/dialects/dialect.js +++ b/app/assets/javascripts/discourse/dialects/dialect.js @@ -254,7 +254,7 @@ Discourse.Dialect = { @param {String} [opts.between] A shortcut for when the `start` and `stop` are the same. @param {Boolean} [opts.rawContents] If true, the contents between the tokens will not be parsed. @param {Boolean} [opts.wordBoundary] If true, the match must be on a word boundary - @param {Boolean} [opts.spaceBoundary] If true, the match must be on a sppace boundary + @param {Boolean} [opts.spaceBoundary] If true, the match must be on a space boundary **/ inlineBetween: function(args) { var start = args.start || args.between, diff --git a/spec/components/pretty_text_spec.rb b/spec/components/pretty_text_spec.rb index 33fc48014b5..2a180c129af 100644 --- a/spec/components/pretty_text_spec.rb +++ b/spec/components/pretty_text_spec.rb @@ -242,6 +242,11 @@ describe PrettyText do describe "markdown quirks" do + 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

" end @@ -249,6 +254,10 @@ describe PrettyText do PrettyText.cook("**hello**\n**world**").should match_html "

hello
world

" end + pending "allows does not bold chinese intra word" do + PrettyText.cook("你**hello**").should match_html "

你**hello**

" + end + pending "does not break a streak for mentions" do Fabricate(:user, username: 'sam') PrettyText.cook("a @sam c").should match_html "

a @sam c

"