disallow _ in tags because they interfer with markdownify

This commit is contained in:
MrZYX 2011-03-21 22:31:01 +01:00
parent 87dafeb67b
commit 88e642ffdb

View file

@ -36,7 +36,7 @@ module Diaspora
def format_tags(text, opts={})
return text if opts[:plain_text]
regex = /(^|\s)#(\w+)/
regex = /(^|\s)#([a-zA-Z0-9\-]+)/
form_message = text.gsub(regex) do |matched_string|
"#{$~[1]}<a href=\"/tags/#{$~[2]}\" class=\"tag\">##{$~[2]}</a>"
end