mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix img alt attribute generation when using Sprockets >= 3.0
This commit is contained in:
parent
9864bcee8c
commit
5e3a23a307
2 changed files with 6 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
* Fix stripping the digest from the automatically generated img tag alt
|
||||
attribute when assets are handled by Sprockets >=3.0.
|
||||
|
||||
*Bart de Water*
|
||||
|
||||
* Create a new `ActiveSupport::SafeBuffer` instance when `content_for` is flushed.
|
||||
|
||||
Fixes #19890
|
||||
|
|
|
@ -239,7 +239,7 @@ module ActionView
|
|||
# image_alt('underscored_file_name.png')
|
||||
# # => Underscored file name
|
||||
def image_alt(src)
|
||||
File.basename(src, '.*'.freeze).sub(/-[[:xdigit:]]{32}\z/, ''.freeze).tr('-_'.freeze, ' '.freeze).capitalize
|
||||
File.basename(src, '.*'.freeze).sub(/-[[:xdigit:]]{32,64}\z/, ''.freeze).tr('-_'.freeze, ' '.freeze).capitalize
|
||||
end
|
||||
|
||||
# Returns an HTML video tag for the +sources+. If +sources+ is a string,
|
||||
|
|
Loading…
Reference in a new issue