Module: Slack::Notifier::Util::Escape

Defined in:
lib/slack-notifier/util/escape.rb

Constant Summary collapse

HTML_REGEXP =
/[&><]/
HTML_REPLACE =
{ "&" => "&amp;", ">" => "&gt;", "<" => "&lt;" }.freeze

Class Method Summary collapse

Class Method Details

.html(string) ⇒ Object



9
10
11
# File 'lib/slack-notifier/util/escape.rb', line 9

def self.html string
  string.gsub(HTML_REGEXP, HTML_REPLACE)
end