module SharedMarkers
  include ActionView::Helpers::TagHelper

  def autolink(link, _link_type)
    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
module SharedMarkers
  include ActionView::Helpers::TagHelper

  def autolink(link, _link_type)
    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
Apply review suggestion from @nilsding
Apply review suggestion from @nilsding

Co-authored-by: Georg Gadinger <9e8f1a26fbf401b045347f083556ffd7c0b25a58@nilsding.org>