From 1d3848424d49dfeb859b15788d09276e3e15f87b Mon Sep 17 00:00:00 2001 From: nilsding Date: Wed, 31 Dec 2014 16:02:34 +0100 Subject: [PATCH] changed regex for matching user mentions --- app/services/flavored_markdown.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/flavored_markdown.rb b/app/services/flavored_markdown.rb index e88f0453..a356d07e 100644 --- a/app/services/flavored_markdown.rb +++ b/app/services/flavored_markdown.rb @@ -6,7 +6,7 @@ class FlavoredMarkdown < Redcarpet::Render::HTML end def wrap_mentions(text) - text.gsub! /(^|\s)(@\w+)/ do + text.gsub! /(^|\s)(@[a-zA-Z0-9_]{1,16})/ do "#{$1}[#{$2}](#{show_user_profile_path $2.tr('@', '')})" end text @@ -23,4 +23,4 @@ class FlavoredMarkdown < Redcarpet::Render::HTML def raw_html(raw_html) Rack::Utils.escape_html raw_html end -end \ No newline at end of file +end