Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #3237 from sakuro/data-url-scheme

Support data: url scheme

Conflicts:
	actionpack/lib/action_view/asset_paths.rb
  • Loading branch information...
commit 2ef29ef9af8634999b8b615ef1643ab630bc59d8 1 parent 9b40f5c
Rafael Mendonça França rafaelfranca authored
2  actionpack/lib/action_view/asset_paths.rb
View
@@ -4,7 +4,7 @@
module ActionView
class AssetPaths #:nodoc:
- URI_REGEXP = %r{^[-a-z]+://|^cid:|^//}
+ URI_REGEXP = %r{^[-a-z]+://|^(?:cid|data):|^//}
attr_reader :config, :controller
2  actionpack/lib/action_view/helpers/asset_tag_helper.rb
View
@@ -389,7 +389,7 @@ def image_tag(source, options={})
src = options[:src] = path_to_image(source)
- unless src =~ /^cid:/
+ unless src =~ /^(?:cid|data):/
options[:alt] = options.fetch(:alt){ image_alt(src) }
end
3  actionpack/test/template/asset_tag_helper_test.rb
View
@@ -205,7 +205,8 @@ def teardown
%(image_tag("//www.rubyonrails.com/images/rails.png")) => %(<img alt="Rails" src="//www.rubyonrails.com/images/rails.png" />),
%(image_tag("mouse.png", :mouseover => "/images/mouse_over.png")) => %(<img alt="Mouse" onmouseover="this.src='/images/mouse_over.png'" onmouseout="this.src='/images/mouse.png'" src="/images/mouse.png" />),
%(image_tag("mouse.png", :mouseover => image_path("mouse_over.png"))) => %(<img alt="Mouse" onmouseover="this.src='/images/mouse_over.png'" onmouseout="this.src='/images/mouse.png'" src="/images/mouse.png" />),
- %(image_tag("mouse.png", :alt => nil)) => %(<img src="/images/mouse.png" />)
+ %(image_tag("mouse.png", :alt => nil)) => %(<img src="/images/mouse.png" />),
+ %(image_tag("data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==", :alt => nil)) => %(<img src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" />),
}
FaviconLinkToTag = {
Please sign in to comment.
Something went wrong with that request. Please try again.