Module: ArticleJSON::Export::Common::HTML::Elements::Quote

Includes:
Shared::Caption, Shared::Float
Included in:
AMP::Elements::Quote, FacebookInstantArticle::Elements::Quote, HTML::Elements::Quote
Defined in:
lib/article_json/export/common/html/elements/quote.rb

Instance Method Summary collapse

Methods included from Shared::Float

#floating_class

Methods included from Shared::Caption

#caption_node

Instance Method Details

#exportNokogiri::XML::NodeSet

Generate the quote node with all its containing text elements

Returns:

  • (Nokogiri::XML::NodeSet)


12
13
14
15
16
17
18
19
20
21
# File 'lib/article_json/export/common/html/elements/quote.rb', line 12

def export
  create_element(quote_tag, node_opts) do |div|
    @element.content.each do |child_element|
      div.add_child(base_class.new(child_element).export)
    end
    if @element.caption&.any?
      div.add_child(caption_node(caption_tag))
    end
  end
end