Module: ArticleJSON::Export::Common::HTML::Elements::Image
- Includes:
- Shared::Caption, Shared::Float
- Defined in:
- lib/article_json/export/common/html/elements/image.rb
Instance Method Summary collapse
-
#export ⇒ Nokogiri::XML::Element
Generate the ‘<figure>` node containing the image and caption.
Methods included from Shared::Float
Methods included from Shared::Caption
Instance Method Details
#export ⇒ Nokogiri::XML::Element
Generate the ‘<figure>` node containing the image and caption
12 13 14 15 16 17 18 19 |
# File 'lib/article_json/export/common/html/elements/image.rb', line 12 def export create_element(:figure, node_opts) do |figure| figure.add_child(image_node) if @element.caption&.any? figure.add_child(caption_node(:figcaption)) end end end |