debian-mirror-gitlab/lib/slack_markdown_sanitizer.rb

12 lines
310 B
Ruby
Raw Normal View History

2023-04-23 21:23:45 +05:30
# 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