Module: Rabbit::Parser::Ext::Escape

Defined in:
lib/rabbit/parser/ext/escape.rb

Constant Summary collapse

META_CHAR =
{"<" => "&#60;", ">" => "&#62;", "&" => "&#38;"}

Class Method Summary collapse

Class Method Details

.escape_meta_character(str) ⇒ Object



10
11
12
13
14
# File 'lib/rabbit/parser/ext/escape.rb', line 10

def escape_meta_character(str)
  str.gsub(/[<>&]/) do
    META_CHAR[$MATCH]
  end
end