Mark links in notes and fetch source data box as external.
This commit is contained in:
@@ -78,8 +78,7 @@ module ApplicationHelper
|
||||
time_tag(time.strftime("%Y-%m-%d %H:%M"), time)
|
||||
end
|
||||
|
||||
def external_link_to(url, truncate: nil, strip: false, **link_options)
|
||||
text = url
|
||||
def external_link_to(url, text = url, truncate: nil, strip: false, **link_options)
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user