Module: Erubi
- Defined in:
- lib/erubi.rb,
lib/erubi/capture.rb
Defined Under Namespace
Classes: Buffer, CaptureEngine, Engine
Constant Summary collapse
- ESCAPE_TABLE =
{'&' => '&'.freeze, '<' => '<'.freeze, '>' => '>'.freeze, '"' => '"'.freeze, "'" => '''.freeze}.freeze
- RANGE_ALL =
0..-1
- RANGE_FIRST =
:nocov:
0..0
- RANGE_LAST =
-1..-1
Class Method Summary collapse
-
.h(value) ⇒ Object
Escape the following characters with their HTML/XML equivalents.
Class Method Details
.h(value) ⇒ Object
Escape the following characters with their HTML/XML equivalents.
13 14 15 |
# File 'lib/erubi.rb', line 13 def self.h(value) value.to_s.gsub(/[&<>"']/, ESCAPE_TABLE) end |