From c920efca2a2916414df41753fb69f26ac0427055 Mon Sep 17 00:00:00 2001 From: DvogelHallowelt <32163064+DvogelHallowelt@users.noreply.github.com> Date: Fri, 18 Oct 2024 07:54:32 +0200 Subject: [PATCH] Allow empty aria label (#50) --- src/AriaAttributesBuilder.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/AriaAttributesBuilder.php b/src/AriaAttributesBuilder.php index f31c4c0..109c986 100644 --- a/src/AriaAttributesBuilder.php +++ b/src/AriaAttributesBuilder.php @@ -21,6 +21,9 @@ public function build( $data ): array { $attribs = []; foreach ( $data as $key => $value ) { + if ( $value === '' ) { + continue; + } $attrib = Sanitizer::safeEncodeTagAttributes( [ "aria-$key" => $value ] );