From 0382ff970d9d398dba565f2f13402bca637710b8 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Thu, 20 Jan 2022 02:07:36 +0100 Subject: [PATCH] Add parser for class attribute --- classes/TagGenerator.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/classes/TagGenerator.php b/classes/TagGenerator.php index 6f4f523..c2db8b1 100644 --- a/classes/TagGenerator.php +++ b/classes/TagGenerator.php @@ -100,7 +100,8 @@ class TagGenerator { 'sizes' => $sizes->implode(', '), $options['lazy'] ? 'data-srcset' : 'srcset' => $srcset->implode(', '), $options['lazy'] ? 'data-src' : 'src' => $files->last()->get('url'), - ])); + 'class' => data_get($options, 'class'), + ])->filter(fn ($value) => (bool) $value)); } public function singleFile(MediaPath $path, ?string $ratio = 'original'): string