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)
|
def link_handles_in(text)
|
||||||
text.scan(/(?:^|\s)@(\w+)/).flatten.uniq.each do |handle|
|
text.scan(/(?:^|\s)@(\w+)/).flatten.uniq.each do |handle|
|
||||||
text.gsub!("@#{handle}", [
|
text.gsub!(/(?:^|\s)@#{handle}/, [
|
||||||
" <a href='https://twitter.com/#{handle}' target='_blank'>",
|
" <a href='https://twitter.com/#{handle}' target='_blank'>",
|
||||||
"@#{handle}",
|
"@#{handle}",
|
||||||
"</a>"
|
"</a>"
|
||||||
].join)
|
].join)
|
||||||
end
|
end
|
||||||
|
|
||||||
text
|
text.strip
|
||||||
end
|
end
|
||||||
|
|
||||||
def link_hashtags_in(text)
|
def link_hashtags_in(text)
|
||||||
|
Loading…
Reference in New Issue
Block a user