diff --git a/app/helpers/markdownify_helper.rb b/app/helpers/markdownify_helper.rb index 8c679201a..bcac67dab 100644 --- a/app/helpers/markdownify_helper.rb +++ b/app/helpers/markdownify_helper.rb @@ -13,7 +13,8 @@ module MarkdownifyHelper :space_after_headers => true, :strikethrough => true, :superscript => true, - :tables => true + :tables => true, + :no_intra_emphasis => true, } render_options[:filter_html] = true diff --git a/spec/helpers/markdownify_helper_spec.rb b/spec/helpers/markdownify_helper_spec.rb index 51c7704c7..b5d22bb8d 100644 --- a/spec/helpers/markdownify_helper_spec.rb +++ b/spec/helpers/markdownify_helper_spec.rb @@ -42,6 +42,24 @@ describe MarkdownifyHelper do formatted.should =~ %r{#markdown} end + it 'should leave multi-underscore tags intact' do + message = Factory.create( + :status_message, + :author => alice.person, + :text => "Here is a #multi_word tag" + ) + formatted = markdownify(message) + formatted.should =~ %r{Here is a #multi_word tag} + + message = Factory.create( + :status_message, + :author => alice.person, + :text => "Here is a #multi_word_tag yo" + ) + formatted = markdownify(message) + formatted.should =~ %r{Here is a #multi_word_tag yo} + end + it "should leave mentions intact" do message = Factory.create(:status_message, :author => alice.person,