Class: Sablon::HTMLConverter::List
- Inherits:
-
Collection
- Object
- Node
- Collection
- Sablon::HTMLConverter::List
- Defined in:
- lib/sablon/html/ast.rb
Overview
Manages the child nodes of a list type tag
Constant Summary
Constants inherited from Node
Instance Attribute Summary
Attributes inherited from Collection
Instance Method Summary collapse
-
#initialize(env, node, properties) ⇒ List
constructor
A new instance of List.
- #inspect ⇒ Object
Methods inherited from Collection
Methods inherited from Node
#accept, convert_style_property, node_name, process_properties, style_conversion, #to_docx
Constructor Details
#initialize(env, node, properties) ⇒ List
Returns a new instance of List.
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
# File 'lib/sablon/html/ast.rb', line 207 def initialize(env, node, properties) # intialize values @list_tag = node.name # @definition = nil if node.ancestors(".//#{@list_tag}").length.zero? # Only register a definition upon the first list tag encountered @definition = env.document.add_list_definition(properties['pStyle']) end # update attributes of all child nodes transfer_node_attributes(node.children, node.attributes) # Move any list tags that are a child of a list item up one level process_child_nodes(node) # convert children from HTML to AST nodes super(ASTBuilder.html_to_ast(env, node.children, properties)) end |
Instance Method Details
#inspect ⇒ Object
227 228 229 |
# File 'lib/sablon/html/ast.rb', line 227 def inspect "<List: #{super}>" end |