Apply review suggestion from @raccube
Co-authored-by: Karina Kwiatek <6197148+raccube@users.noreply.github.com>
This commit is contained in:
parent
0a530bfd63
commit
48c31ebdc6
|
@ -2,16 +2,14 @@ module SharedMarkers
|
|||
include ActionView::Helpers::TagHelper
|
||||
|
||||
def autolink(link, _link_type)
|
||||
begin
|
||||
href = if ALLOWED_HOSTS_IN_MARKDOWN.include?(URI(link).host)
|
||||
link
|
||||
else
|
||||
linkfilter_path(url: link)
|
||||
end
|
||||
|
||||
content_tag(:a, link, href: href, target: "_blank", rel: "nofollow")
|
||||
rescue
|
||||
link
|
||||
end
|
||||
href = if ALLOWED_HOSTS_IN_MARKDOWN.include?(URI(link).host)
|
||||
link
|
||||
else
|
||||
linkfilter_path(url: link)
|
||||
end
|
||||
|
||||
content_tag(:a, link, href: href, target: "_blank", rel: "nofollow")
|
||||
rescue
|
||||
link
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue