Module: Cheepub::Converter::CheeHtml

Included in:
Kramdown::Converter::Html
Defined in:
lib/cheepub/converter/cheehtml.rb

Instance Method Summary collapse

Instance Method Details

#convert_img(el, indent) ⇒ Object



10
11
12
13
14
15
# File 'lib/cheepub/converter/cheehtml.rb', line 10

def convert_img(el, indent)
  if !@options[:ignore_images]
    replace_img_path(el)
  end
  super
end

#initialize(root, options) ⇒ Object



5
6
7
8
# File 'lib/cheepub/converter/cheehtml.rb', line 5

def initialize(root, options)
  super
  @asset_store = @options[:asset_store]
end

#replace_img_path(el) ⇒ Object



17
18
19
20
21
# File 'lib/cheepub/converter/cheehtml.rb', line 17

def replace_img_path(el)
  src = el.attr['src']
  img_path = @asset_store.store(src, Cheepub::IMAGE_DIR)
  el.attr['src'] = img_path
end