summaryrefslogtreecommitdiff
path: root/lib/slack_markdown_sanitizer.rb
blob: df3bec1a3c8ad54bdc212776ffd5379d8613ea7f (plain)
1
2
3
4
5
6
7
8
9
10
11
# frozen_string_literal: true

module SlackMarkdownSanitizer
  # Markup characters which are used for links in HTML, Markdown,
  # and Slack "mrkdwn" syntax (`<http://example.com|Label>`).
  UNSAFE_MARKUP_CHARACTERS = '<>[]|'

  def self.sanitize(string)
    string&.delete(UNSAFE_MARKUP_CHARACTERS)
  end
end