class Slack::Notifier::Util::LinkFormatter

def formatted

rubocop:disable Lint/RescueWithoutErrorClass
def formatted
  return @orig unless @orig.respond_to?(:gsub)
  sub_markdown_links(sub_html_links(@orig))
rescue => e
  raise e unless RUBY_VERSION < "2.1" && e.message.include?("invalid byte sequence")
  raise e, "#{e.message}. Consider including the 'string-scrub' gem to strip invalid characters"
end