def convert_image_urls(html, filename)
      dir_string = ::File.dirname(::File.expand_path(filename))
      html.scan(/<img[^>]+src="([^"]+)"/).each do |url|
        html.gsub!(url[0], ::File.expand_path(url[0], dir_string)) unless url[0] =~ /^https?/
      end

      html
    end
def convert_image_urls(html, filename)
      dir_string = ::File.dirname(::File.expand_path(filename))
      html.scan(/<img[^>]+src="([^"]+)"/).each do |url|
        html.gsub!(url[0], ::File.expand_path(url[0], dir_string)) unless url[0] =~ /^https?/
      end

      html
    end
Rewrite relative image urls to absolute
 @param [String] html some html to parse
 @return [String] the html with all image urls replaced to absolute