about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMingye Wang <arthur200126@gmail.com>2017-04-21 12:18:58 -0400
committerEugen <eugen@zeonfederated.com>2017-04-21 18:18:58 +0200
commit5c9aa2b7329fe5bd87cee583e33c7b5c1eac4566 (patch)
treedcbc53a5d59de8e7427008e43cd21f36698eb1be
parent78af88e1f4389b821815316f03a27be1b55e61da (diff)
Fix mangling of ##tag matches (#2194) (#2247)
This commit fixes hashtag_html so it correctly handles matches with multiple hash-signs.

Bug located by @over9001, initial fix suggested by @nightpool.
-rw-r--r--app/lib/formatter.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb
index 43893915d..f539512a5 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