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.
lolsob-rspec
Mingye Wang 2017-04-21 12:18:58 -04:00 committed by Eugen
parent 04bbf79994
commit e3fbd2db30
1 changed files with 1 additions and 1 deletions

View File

@ -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