mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: do not replace twitter handles in URLs
This commit is contained in:
parent
b284464a91
commit
6cd0b7316a
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user