Welcome to mirror list, hosted at ThFree Co, Russian Federation.

slack_markdown_sanitizer.rb « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
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