Module: ArticleJSON::Export::Common::HTML::Elements::Shared::Caption

Included in:
Embed, Image, Quote, FacebookInstantArticle::Elements::Embed
Defined in:
lib/article_json/export/common/html/elements/shared/caption.rb

Instance Method Summary collapse

Instance Method Details

#caption_node(tag_name) ⇒ Nokogiri::XML::NodeSet

Generate the caption node

Parameters:

  • tag_name (String)

Returns:

  • (Nokogiri::XML::NodeSet)


11
12
13
14
15
16
17
# File 'lib/article_json/export/common/html/elements/shared/caption.rb', line 11

def caption_node(tag_name)
  create_element(tag_name) do |caption|
    @element.caption.each do |child_element|
      caption.add_child(text_exporter.new(child_element).export)
    end
  end
end