Class: HerbTr8nStringNode
- Inherits:
-
Object
- Object
- HerbTr8nStringNode
- Defined in:
- lib/nodes/herb_tr8n_string_node.rb
Overview
This class is mostly responsible for all of the escaping that needs to occur for Tr8n to correctly understand the string.
Constant Summary collapse
- ESCAPE_LOOKUP_TABLE =
[ ["\"", "quot"], ["\n", "br"], ["–", "ndash"], ["—", "mdash"], ["¡", "iexcl"], ["¿", "iquest"], [""", "quot"], ["“", "ldquo"], ["”", "rdquo"], ["‘", "lsquo"], ["’", "rsquo"], ["«", "laquo"], ["»", "raquo"], [" ", "nbsp"] ]
Instance Method Summary collapse
-
#initialize(string) ⇒ HerbTr8nStringNode
constructor
A new instance of HerbTr8nStringNode.
- #text_value ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(string) ⇒ HerbTr8nStringNode
Returns a new instance of HerbTr8nStringNode.
23 24 25 |
# File 'lib/nodes/herb_tr8n_string_node.rb', line 23 def initialize( string ) @escaped_string = tr8n_escape( string ) end |
Instance Method Details
#text_value ⇒ Object
27 28 29 |
# File 'lib/nodes/herb_tr8n_string_node.rb', line 27 def text_value @escaped_string end |
#to_s ⇒ Object
31 32 33 |
# File 'lib/nodes/herb_tr8n_string_node.rb', line 31 def to_s text_value end |