Module: Slack::Messenger::Util::Escape

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

Constant Summary collapse

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

Class Method Summary collapse

Class Method Details

.html(string) ⇒ Object



10
11
12
# File 'lib/slack-messenger/util/escape.rb', line 10

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