Class: Sablon::Content::HTML
- Inherits:
-
Struct
- Object
- Struct
- Sablon::Content::HTML
- Includes:
- Sablon::Content
- Defined in:
- lib/sablon/content.rb
Overview
Handles conversion of HTML -> WordML and addition into template
Instance Attribute Summary collapse
-
#html_content ⇒ Object
Returns the value of attribute html_content.
Class Method Summary collapse
Instance Method Summary collapse
- #append_to(paragraph, display_node, env) ⇒ Object
-
#initialize(value) ⇒ HTML
constructor
A new instance of HTML.
Methods included from Sablon::Content
Constructor Details
#initialize(value) ⇒ HTML
Returns a new instance of HTML.
164 165 166 |
# File 'lib/sablon/content.rb', line 164 def initialize(value) super value end |
Instance Attribute Details
#html_content ⇒ Object
Returns the value of attribute html_content
159 160 161 |
# File 'lib/sablon/content.rb', line 159 def html_content @html_content end |
Class Method Details
.id ⇒ Object
161 |
# File 'lib/sablon/content.rb', line 161 def self.id; :html end |
.wraps?(value) ⇒ Boolean
162 |
# File 'lib/sablon/content.rb', line 162 def self.wraps?(value) false end |
Instance Method Details
#append_to(paragraph, display_node, env) ⇒ Object
168 169 170 171 172 |
# File 'lib/sablon/content.rb', line 168 def append_to(paragraph, display_node, env) converter = HTMLConverter.new word_ml = WordML.new(converter.process(html_content, env)) word_ml.append_to(paragraph, display_node, env) end |