FIX: do not replace twitter handles in URLs

This commit is contained in:
Arpit Jalan 2018-05-17 00:18:19 +05:30
parent b284464a91
commit 6cd0b7316a

View File

@ -54,14 +54,14 @@ class TwitterApi
def link_handles_in(text)
text.scan(/(?:^|\s)@(\w+)/).flatten.uniq.each do |handle|
text.gsub!("@#{handle}", [
"<a href='https://twitter.com/#{handle}' target='_blank'>",
text.gsub!(/(?:^|\s)@#{handle}/, [
" <a href='https://twitter.com/#{handle}' target='_blank'>",
"@#{handle}",
"</a>"
].join)
end
text
text.strip
end
def link_hashtags_in(text)