<commit_before>
module RetinaTag
  module TagHelper
    def self.included(base)
      base.alias_method_chain :image_tag, :retina
    end

    def image_tag_with_retina(source,options={})
      hidpi_asset_path = nil
      src = options[:src] = path_to_image(source)

      begin
          retina_els = source.split('.')
          extension = retina_els.last
          retina_els.slice!(-1)
          retina_path = "#{retina_els.join('.')}@2x.#{extension}"

          if !Rails.application.assets.find_asset(retina_path).nil?
            hidpi_asset_path = asset_path(retina_path)
          end
      rescue
      end
      options_default = { "data-hidpi-src" => hidpi_asset_path }

      if lazy = options.delete(:lazy)
        options["data-lazy-load"] = lazy
      end

      options_default.merge!(options)
      image_tag_without_retina(source,options_default)

      if options_default[:"data-lazy-load"]
        options_default["data-lowdpi-src"] = options_default.delete(:src)
      end

      tag("img", options_default)
    end


  end

  class Engine < ::Rails::Engine
    initializer :retina_tag_image_tag do
      ActionView::Helpers::AssetTagHelper.module_eval do
        include TagHelper
      end

    end
  end
end<commit_msg>Return chained image_tag to fix "size" attribute handling.<commit_after>
module RetinaTag
  module TagHelper
    def self.included(base)
      base.alias_method_chain :image_tag, :retina
    end

    def image_tag_with_retina(source,options={})
      hidpi_asset_path = nil
      src = options[:src] = path_to_image(source)

      begin
          retina_els = source.split('.')
          extension = retina_els.last
          retina_els.slice!(-1)
          retina_path = "#{retina_els.join('.')}@2x.#{extension}"

          if !Rails.application.assets.find_asset(retina_path).nil?
            hidpi_asset_path = asset_path(retina_path)
          end
      rescue
      end
      options_default = { "data-hidpi-src" => hidpi_asset_path }

      if lazy = options.delete(:lazy)
        options["data-lazy-load"] = lazy
      end

      options_default.merge!(options)

      if options_default[:"data-lazy-load"]
        options_default["data-lowdpi-src"] = options_default.delete(:src)
      end

      image_tag_without_retina(source, options_default)
    end


  end

  class Engine < ::Rails::Engine
    initializer :retina_tag_image_tag do
      ActionView::Helpers::AssetTagHelper.module_eval do
        include TagHelper
      end

    end
  end
end
{'fraction_non_alphanumeric': 0.10151878497202238, 'fraction_numerical': 0.0015987210231814548, 'mean_word_length': 2.6486880466472305, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4977258', 'n_tokens_mistral': 809, 'n_tokens_neox': 798, 'n_words': 139}