diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb
index 43893915d4a6f555ba687c44a8d3e0b99dc5818e..f539512a55fab76c8b9809329fa65612da22f408 100644
--- a/app/lib/formatter.rb
+++ b/app/lib/formatter.rb
@@ -109,7 +109,7 @@ class Formatter
   end
 
   def hashtag_html(match)
-    prefix, affix = match.split('#')
+    prefix, _, affix = match.rpartition('#')
     "#{prefix}<a href=\"#{tag_url(affix.downcase)}\" class=\"mention hashtag\">#<span>#{affix}</span></a>"
   end