Module: ArticleJSON::Export::Common::HTML::Elements::Embed

Includes:
Shared::Caption
Included in:
AMP::Elements::Embed, HTML::Elements::Embed
Defined in:
lib/article_json/export/common/html/elements/embed.rb

Instance Method Summary collapse

Methods included from Shared::Caption

#caption_node

Instance Method Details

#exportNokogiri::XML::NodeSet

Generate the embedded element node

Returns:

  • (Nokogiri::XML::NodeSet)


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

def export
  create_element(:figure) do |figure|
    figure.add_child(embed_node)
    if @element.caption&.any?
      figure.add_child(caption_node(:figcaption))
    end
  end
end