use strict;
use warnings;
use utf8;
use Test::More tests => 1;
my $in = <This is a test posting.- Hello there!
- How are you?
- Very well I hope!
This is the end of the posting.
';
my $have = '';
my $inlist = 0;
for (split /\n/, $in) {
if (s/•\s*/
/) {
$_ .= '';
$_ = '' . $_ unless $inlist;
$inlist = 1;
} elsif ($inlist) {
$_ = '
' . $_;
$inlist = 0;
}
$have .= $_;
}
$have .= '';
is $have, $want;