From 1284fcc92df8cc3bc656b6ef9873447cd98ab17e Mon Sep 17 00:00:00 2001 From: MrZYX Date: Mon, 13 Dec 2010 14:22:57 +0100 Subject: [PATCH] fix for #699 --- app/helpers/application_helper.rb | 4 ++-- spec/helpers/application_helper_spec.rb | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 8fb6647d4..64c8c27e4 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -193,8 +193,8 @@ module ApplicationHelper end if options[:autolinks] - message.gsub!(/( |^)(www\.[^ ]+\.[^ ])/, '\1http://\2') - message.gsub!(/(are
some
new
lines" end + + it 'should render newlines and basic http links correctly' do + message = "Some text, then a line break and a link\nhttp://joindiaspora.com\nsome more text" + res = markdownify(message) + res.should == 'Some text, then a line break and a link
joindiaspora.com
some more text' + end end context 'performance' do