Module: ArticleJSON::Export::Common::HTML::Elements::List

Included in:
AMP::Elements::List, FacebookInstantArticle::Elements::List, HTML::Elements::List
Defined in:
lib/article_json/export/common/html/elements/list.rb

Instance Method Summary collapse

Instance Method Details

#exportNokogiri::XML::NodeSet

Generate the list node with its elements

Returns:

  • (Nokogiri::XML::NodeSet)


9
10
11
12
13
14
15
16
17
18
# File 'lib/article_json/export/common/html/elements/list.rb', line 9

def export
  create_element(tag_name) do |list|
    @element.content.each do |child_element|
      list_item_wrapper = create_element(:li) do |item|
        item.add_child(paragraph_exporter.new(child_element).export)
      end
      list.add_child(list_item_wrapper)
    end
  end
end