diff --git a/lib/diaspora/taggable.rb b/lib/diaspora/taggable.rb index 74b4377ff..2eff35442 100644 --- a/lib/diaspora/taggable.rb +++ b/lib/diaspora/taggable.rb @@ -4,7 +4,7 @@ module Diaspora module Taggable - VALID_TAG_BODY = /[^_,\s#*\[\]()\:\@\/"'\.%]+/ + VALID_TAG_BODY = /[^_,\s#*\[\]()\@\/"'\.%]+\b/ def self.included(model) model.class_eval do diff --git a/spec/shared_behaviors/taggable.rb b/spec/shared_behaviors/taggable.rb index 4a7838601..0b1bd95f0 100644 --- a/spec/shared_behaviors/taggable.rb +++ b/spec/shared_behaviors/taggable.rb @@ -39,8 +39,8 @@ describe Diaspora::Taggable do end describe '#tag_strings' do it 'returns a string for every #thing' do - str = '#what #hey #that"smybike. #@hey ##boo # #THATWASMYBIKE #vöglein #hey#there #135440we #abc/23 ###' - arr = ['what', 'hey', 'that', 'THATWASMYBIKE', 'vöglein', '135440we', 'abc'] + str = '#what #hey #that"smybike. #@hey ##boo # #THATWASMYBIKE #vöglein #hey#there #135440we #abc/23 ### #h!gh #ok? #see: #re:publica' + arr = ['what', 'hey', 'that', 'THATWASMYBIKE', 'vöglein', '135440we', 'abc', 'h!gh', 'ok', 'see', 're:publica'] @object.send(@object.class.field_with_tags_setter, str) @object.tag_strings.should =~ arr