From: Mingye Wang Date: Fri, 21 Apr 2017 16:18:58 +0000 (-0400) Subject: Fix mangling of ##tag matches (#2194) (#2247) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=5c9aa2b7329fe5bd87cee583e33c7b5c1eac4566;p=mastodon.git 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. --- 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}##{affix}" end