+ #warn "writer called with format $format\n";
+
+ if ( ref $value eq 'ARRAY' ) {
+ # imitate the write_row() method: write the array into a column starting
+ # with $r.
+ # (currently only used in the footer; to use it anywhere else we'd need
+ # some way to return the number of rows written)
+ foreach my $v (@$value) {
+ $writer->($r, $c, $v, $format);
+ $r++;
+ }
+ return;
+ }
+
+ my $bold = 0;
+ my $date = 0;
+ if ( $style->[$c] eq 'b' or $value =~ /<b>/i ) { # the only one in common use
+ $value =~ s[</?b>][]ig;
+ if ( !exists($bold_format{$format}) ) {
+ $bold_format{$format} = $workbook->add_format();
+ $bold_format{$format}->copy($format);
+ $bold_format{$format}->set_bold();
+ }
+ $format = $bold_format{$format};
+ $bold = 1;
+ }
+
+ # convert HTML entities
+ # both Spreadsheet::WriteExcel and Excel::Writer::XLSX accept UTF-8 strings
+ $value = decode_entities($value);
+