Module: Erubi

Defined in:
lib/erubi.rb,
lib/erubi/capture_end.rb

Defined Under Namespace

Classes: CaptureEndEngine, Engine

Constant Summary collapse

ESCAPE_TABLE =
{'&' => '&amp;'.freeze, '<' => '&lt;'.freeze, '>' => '&gt;'.freeze, '"' => '&quot;'.freeze, "'" => '&#039;'.freeze}.freeze
RANGE_ALL =
0..-1
RANGE_FIRST =

:nocov:

0..0
RANGE_LAST =
-1..-1
TEXT_END =
"';"

Class Method Summary collapse

Class Method Details

.h(value) ⇒ Object

Escape the following characters with their HTML/XML equivalents.



14
15
16
# File 'lib/erubi.rb', line 14

def self.h(value)
  value.to_s.gsub(/[&<>"']/, ESCAPE_TABLE)
end