class Asciidoctor::Extensions::Processor

def create_image_block parent, attrs, opts = {}

Returns a [Block] node with all properties properly initialized.

opts - An optional Hash of options (default: {})
Use the alt attribute to specify an alternative text for the image.
Use the target attribute to set the source of the image.
attrs - A Hash of attributes to control how the image block is built.
parent - The parent Block (Block, Section, or Document) of this new image block.

Public: Creates an image block node and links it to the specified parent.
def create_image_block parent, attrs, opts = {}
  unless (target = attrs['target'])
    raise ::ArgumentError, 'Unable to create an image block, target attribute is required'
  end
  attrs['alt'] ||= (attrs['default-alt'] = Helpers.basename(target, true).tr('_-', ' '))
  title = (attrs.key? 'title') ? (attrs.delete 'title') : nil
  block = create_block parent, :image, nil, attrs, opts
  if title
    block.title = title
    block.assign_caption (attrs.delete 'caption'), 'figure'
  end
  block
end