return sprintf '== %s ==', $report->{title};
}
+my $_prepare_column_content = sub {
+ my ($content) = @_;
+ return ''
+ unless defined $content;
+ my @lines = split m{\n}, $content;
+ if (@lines == 1) {
+ return $content;
+ }
+ else {
+ my ($first, @rest) = @lines;
+ return HTML::Zoom->from_events([
+ { type => 'TEXT', raw => $first },
+ map {
+ my $string = $_;
+ ( @{ HTML::Zoom->from_html('<br/>')->to_events },
+ { type => 'TEXT', raw => $string });
+ } @rest,
+ ]);
+ }
+};
+
sub _apply_table_body {
my ($self, $markup, $report) = @_;
my $index = 0;
$_->apply_if($col !~ m{^__}, sub {
$_->add_to_attribute('td', class => "si-column-$col");
})
- ->replace_content('td', defined($value) ? $value : '')
+ ->replace_content('td', $value->$_prepare_column_content)
->apply_if($col_idx != $#cols, sub {
$_->add_after('td', "\n ");
});