my ($stream, $type) = @_;
my @events;
until ($stream->$_is_type(close => $type)) {
- push @events, $stream->next;
+ my $next = $stream->next;
+ if ($next->{type} eq 'OPEN' and $next->{name} eq 'br') {
+ push @events, { type => 'TEXT', raw => "\n" };
+ }
+ else {
+ push @events, $next;
+ }
}
return HTML::Zoom->from_events(\@events)->to_html;
};