debian-mirror-gitlab/lib/slack_markdown_sanitizer.rb
2023-04-23 21:23:45 +05:30

11 lines
310 B
Ruby

# 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