return $string;
}
+sub join_values {
+ my ($name, $value) = @_;
+ my $spacer = $name eq 'class' ? ' ' : ''; # join classes with spaces, everything else as is
+
+ ref $value && 'ARRAY' eq ref $value
+ ? join $spacer, map { join_values($name, $_) } @$value
+ : $value
+}
+
sub stringify_attributes {
my (%params) = @_;
next unless $name;
next if $_valueless_attributes{$name} && !$value;
$value = '' if !defined($value);
+ $value = join_values($name, $value) if ref $value && 'ARRAY' eq ref $value;
push @result, $_valueless_attributes{$name} ? escape($name) : escape($name) . '="' . escape($value) . '"';
}