Skip to content

Commit 911dae3

Browse files
authored
Merge pull request #455 from BeAPI/fix/a11y-crop-attribute
Remplacement de l'attribut `crop` par `data-crop` pour des raisons de normes W3C.
2 parents fb5a292 + 62554b9 commit 911dae3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

config/WebpackImageSizesPlugin.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class WebpackImageSizesPlugin {
4747
const that = this
4848
const regex = {
4949
srcset: /srcset="(.[^"]*)"/gm,
50-
crop: /crop="(.[^"]*)"/gm,
50+
crop: /data-crop="(.[^"]*)"/gm,
5151
img: /img-\d*-\d*/gm,
5252
}
5353

@@ -164,7 +164,7 @@ class WebpackImageSizesPlugin {
164164
srcsetArr.forEach((src) => {
165165
const dimensions = src.match(regex.img)
166166
const retina = isRetina(src)
167-
const crop = !(cropArr && cropArr[0] === 'crop="false"')
167+
const crop = !(cropArr && cropArr[0] === 'data-crop="false"')
168168

169169
dimensions.forEach((size, index) => {
170170
const splitSize = size.split('-')

0 commit comments

Comments
 (0)