diff --git a/app/assets/javascripts/pretty-text/engines/markdown-it/onebox.js.es6 b/app/assets/javascripts/pretty-text/engines/markdown-it/onebox.js.es6 index 03c069475ea..e2babeafbeb 100644 --- a/app/assets/javascripts/pretty-text/engines/markdown-it/onebox.js.es6 +++ b/app/assets/javascripts/pretty-text/engines/markdown-it/onebox.js.es6 @@ -17,7 +17,7 @@ function applyOnebox(state, silent) { for(j=0;j 0 && token.children[j-1].tag !== 'br') { diff --git a/spec/components/pretty_text_spec.rb b/spec/components/pretty_text_spec.rb index 9e9b26fa0c7..96104ff60ee 100644 --- a/spec/components/pretty_text_spec.rb +++ b/spec/components/pretty_text_spec.rb @@ -312,7 +312,7 @@ HTML expect(PrettyText.excerpt(emoji_code, 100)).to eq(":heart:") end - context 'option ot preserve onebox source' do + context 'option to preserve onebox source' do it "should return the right excerpt" do onebox = "\n\n\n" expected = "meta.discourse.org" @@ -629,6 +629,7 @@ HTML expect(PrettyText.cook("http://a.com ")).to include('onebox') expect(PrettyText.cook("http://a.com a")).not_to include('onebox') expect(PrettyText.cook("- http://a.com")).not_to include('onebox') + expect(PrettyText.cook("")).not_to include('onebox') end it "can handle bbcode" do