kamifusen 1.10 → 1.10.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc161cf43bce3f420864d28ab413979ed4c224c163ca872e78453bbd0d950c7f
4
- data.tar.gz: 30796fb41b0280a5be83a29016cda1651514e80386014b402a0c6da627174b6d
3
+ metadata.gz: 623f43a95efe95c7f4966df6584d2e92abfa8b870b94e018e0a97a06221cf110
4
+ data.tar.gz: e9d1711c003fde435452257b1b43b239f5604606d65c86ba66d1408cae8cfd6d
5
5
  SHA512:
6
- metadata.gz: 6f72675f224e8e87f64f4ada42f9c0cb4e86ed7c7002ad5316b2831048d52e8b1b9691ed8381a6484d12b9717f99cf49b36d05b1313198b2356e0cf307d6960d
7
- data.tar.gz: 0fb2c26afde61d40cbb96f84c26416d0809cccec2a0fe37188925727a011f965fdcdfc045808293c7209198a597dc2a4641ec142d1bd19cc308db10c20404f7a
6
+ metadata.gz: a68d9c2bb398bd911934c2b77b3f08f576045d518b4ab30d01cedac10762c05d2382aa680ee6c3365b7eddeb523329779ffd3e1679d09aa5b10c47462cc51f30
7
+ data.tar.gz: 1499e4a4e86300c822a8c812c1e52c80c4b61851aa5bbafb8e04965276afe2923d2f689ffeef617770e9bed8dc7934d55220d2adfb48bd3139a4f71e816dfdd1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kamifusen (1.10)
4
+ kamifusen (1.10.1)
5
5
  image_processing
6
6
  rails
7
7
 
data/README.md CHANGED
@@ -32,6 +32,13 @@ If you want to disable webp, in config/initializers/kamifusen.rb:
32
32
  Kamifusen.with_webp = false
33
33
  ```
34
34
 
35
+ If you render kamifusen tags inside a sanitized text, please make sure you allow these tags and attributes in `config/application.yml`:
36
+
37
+ ```ruby
38
+ config.action_view.sanitized_allowed_tags = ['picture', 'source', 'img']
39
+ config.action_view.sanitized_allowed_attributes = ['src', 'type', 'srcset', 'width', 'height', 'alt', 'sizes', 'loading', 'decoding']
40
+ ```
41
+
35
42
  ## Usage
36
43
 
37
44
  Simply use `kamifusen_tag` instead of `image_tag` in your rails views.## What's the problem?
@@ -85,14 +85,13 @@ end
85
85
  <picture<%= " class=\"#{picture_class}\"".html_safe unless picture_class.blank? %>>
86
86
  <% if Kamifusen.with_webp %>
87
87
  <source srcset="<%= srcset_webp %>"
88
- type="image/webp"
89
- <%= " sizes=\"#{sizes.map { |key, value| [key, value].join(' ') }.join(', ')}\"".html_safe unless sizes.empty? %>>
88
+ <%= " sizes=\"#{sizes.map { |key, value| [key, value].join(' ') }.join(', ')}\"".html_safe unless sizes.empty? %>
89
+ type="image/webp">
90
90
  <% end %>
91
- <img src="<%= default %>"
92
- srcset="<%= srcset_default %>"
93
- type="<%= source.content_type %>"
94
- <%= " sizes=\"#{sizes.map { |key, value| [key, value].join(' ') }.join(', ')}\"".html_safe unless sizes.empty? %>
95
- <%= raw parameters %>>
91
+ <source srcset="<%= srcset_default %>"
92
+ <%= " sizes=\"#{sizes.map { |key, value| [key, value].join(' ') }.join(', ')}\"".html_safe unless sizes.empty? %>
93
+ type="<%= source.content_type %>">
94
+ <img src="<%= default %>" <%= raw parameters %>>
96
95
  </picture>
97
96
  <% else %>
98
97
  <picture>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kamifusen
4
- VERSION = "1.10"
4
+ VERSION = "1.10.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kamifusen
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.10'
4
+ version: 1.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sébastien Moulène