class Asciidoctor::Converter::Html5Converter

def convert_image node

def convert_image node
  target = node.attr 'target'
  width_attr = (node.attr? 'width') ? %( width="#{node.attr 'width'}") : ''
  height_attr = (node.attr? 'height') ? %( height="#{node.attr 'height'}") : ''
  if ((node.attr? 'format', 'svg') || (target.include? '.svg')) && node.document.safe < SafeMode::SECURE &&
      ((svg = (node.option? 'inline')) || (obj = (node.option? 'interactive')))
    if svg
      img = (read_svg_contents node, target) || %(<span class="alt">#{node.alt}</span>)
    elsif obj
      fallback = (node.attr? 'fallback') ? %(<img src="#{node.image_uri(node.attr 'fallback')}" alt="#{encode_attribute_value node.alt}"#{width_attr}#{height_attr}#{@void_element_slash}>) : %(<span class="alt">#{node.alt}</span>)
      img = %(<object type="image/svg+xml" data="#{node.image_uri target}"#{width_attr}#{height_attr}>#{fallback}</object>)
    end
  end
  img ||= %(<img src="#{node.image_uri target}" alt="#{encode_attribute_value node.alt}"#{width_attr}#{height_attr}#{@void_element_slash}>)
  if node.attr? 'link'
    img = %(<a class="image" href="#{node.attr 'link'}"#{(append_link_constraint_attrs node).join}>#{img}</a>)
  end
  id_attr = node.id ? %( id="#{node.id}") : ''
  classes = ['imageblock']
  classes << (node.attr 'float') if node.attr? 'float'
  classes << %(text-#{node.attr 'align'}) if node.attr? 'align'
  classes << node.role if node.role
  class_attr = %( class="#{classes.join ' '}")
  title_el = node.title? ? %(\n<div class="title">#{node.captioned_title}</div>) : ''
  %(<div#{id_attr}#{class_attr}>
iv class="content">
img}
div>#{title_el}
div>)
end