Skip to content

Commit 62554b9

Browse files
committed
fix (a11y): replace crop attribute with data-crop in WebpackImageSizesPlugin for a11y purpose
1 parent 032dfa0 commit 62554b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

config/WebpackImageSizesPlugin.js

Lines changed: 2 additions & 2 deletions
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)