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.
169 170 171 |
# File 'lib/sablon/content.rb', line 169 def initialize(value) super value end |
Instance Attribute Details
#html_content ⇒ Object
Returns the value of attribute html_content
164 165 166 |
# File 'lib/sablon/content.rb', line 164 def html_content @html_content end |
Class Method Details
.id ⇒ Object
166 |
# File 'lib/sablon/content.rb', line 166 def self.id; :html end |
.wraps?(value) ⇒ Boolean
167 |
# File 'lib/sablon/content.rb', line 167 def self.wraps?(value) false end |
Instance Method Details
#append_to(paragraph, display_node, env) ⇒ Object
173 174 175 176 177 |
# File 'lib/sablon/content.rb', line 173 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 |