media assets: add options to download or reverse search the image.

This commit is contained in:
evazion
2022-11-29 14:14:52 -06:00
parent ba8ff9e0a0
commit 695568e08b
6 changed files with 71 additions and 11 deletions

View File

@@ -180,7 +180,8 @@ module ApplicationHelper
time_tag(time.strftime("%Y-%m-%d %H:%M"), time)
end
def external_link_to(url, text = url, truncate: nil, strip: false, **link_options)
def external_link_to(url, text = url, truncate: nil, strip: false, **link_options, &block)
text = capture { yield } if block_given?
text = text.gsub(%r{\Ahttps?://}i, "") if strip == :scheme
text = text.gsub(%r{\Ahttps?://(?:www\.)?}i, "") if strip == :subdomain
text = text.truncate(truncate) if truncate