# File lib/asciidoctor/backends/html5.rb, line 860 def image(target, alt, title, link, node) align = (node.attr? 'align') ? (node.attr 'align') : nil float = (node.attr? 'float') ? (node.attr 'float') : nil if align || float styles = [align ? %(text-align: #{align}) : nil, float ? %(float: #{float}) : nil].compact style_attribute = %( style="#{styles * ';'}") else style_attribute = nil end width_attribute = (node.attr? 'width') ? %( width="#{node.attr 'width'}") : nil height_attribute = (node.attr? 'height') ? %( height="#{node.attr 'height'}") : nil img_element = %(<img src="#{node.image_uri target}" alt="#{alt}"#{width_attribute}#{height_attribute}>) if link img_element = %(<a class="image" href="#{link}">#{img_element}</a>) end id_attribute = node.id ? %( id="#{node.id}") : nil classes = ['imageblock', node.style, node.role].compact class_attribute = %( class="#{classes * ' '}") title_element = title ? %(\n<div class="title">#{title}</div>) : nil %(<div#{id_attribute}#{class_attribute}#{style_attribute}> <div class="content"> #{img_element} </div>#{title_element} </div>) end
Generated with the Darkfish Rdoc Generator 2.