From db4bfb73a9c03a6c1541c08be2c0ac8e2f50ebb9 Mon Sep 17 00:00:00 2001 From: Pistos Date: Tue, 1 Nov 2011 23:35:34 -0400 Subject: [PATCH] Fix issue #2213: multi-underscore hashtags no longer get Markdown phasis applied. --- app/helpers/markdownify_helper.rb | 3 ++- spec/helpers/markdownify_helper_spec.rb | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) 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,