Module: Rabbit::Parser::RD::Ext::Image

Includes:
Ext::Image
Included in:
BlockVerbatim, InlineVerbatim, Refer
Defined in:
lib/rabbit/parser/rd/ext/image.rb

Instance Method Summary collapse

Methods included from Ext::Image

make_image, make_image_from_file

Instance Method Details

#img(label, content, visitor) ⇒ Object


11
12
13
14
15
# File 'lib/rabbit/parser/rd/ext/image.rb', line 11

def img(label, content, visitor)
  label = label.to_s
  return nil unless /^img:\s*(.+)$/ =~ label
  make_image(visitor.canvas, $1)
end

#make_image_from_file(source, visitor) ⇒ Object


17
18
19
20
21
22
# File 'lib/rabbit/parser/rd/ext/image.rb', line 17

def make_image_from_file(source, visitor)
  src, prop = parse_source(source)
  super(visitor.canvas, src) do |src_file_path|
    [yield(src_file_path, prop), prop]
  end
end