mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: do not replace hashtags in URLs
This commit is contained in:
@@ -66,15 +66,15 @@ class TwitterApi
|
|||||||
|
|
||||||
def link_hashtags_in(text)
|
def link_hashtags_in(text)
|
||||||
text.scan(/(?:^|\s)#(\w+)/).flatten.uniq.each do |hashtag|
|
text.scan(/(?:^|\s)#(\w+)/).flatten.uniq.each do |hashtag|
|
||||||
text.gsub!("##{hashtag}", [
|
text.gsub!(/(?:^|\s)##{hashtag}/, [
|
||||||
"<a href='https://twitter.com/search?q=%23#{hashtag}' ",
|
" <a href='https://twitter.com/search?q=%23#{hashtag}' ",
|
||||||
"target='_blank'>",
|
"target='_blank'>",
|
||||||
"##{hashtag}",
|
"##{hashtag}",
|
||||||
"</a>"
|
"</a>"
|
||||||
].join)
|
].join)
|
||||||
end
|
end
|
||||||
|
|
||||||
text
|
text.strip
|
||||||
end
|
end
|
||||||
|
|
||||||
def user_timeline_uri_for(screen_name)
|
def user_timeline_uri_for(screen_name)
|
||||||
|
|||||||
Reference in New Issue
Block a user