\n"; print @p; print "\n"; undef @p; } } while(
";
push @q, "$2. $3";
my $line;
$indent = length($1);
$first = " " x $indent;
#print "$indent|$first|$1|\n";
while( ";
push @a, $line;
$prev='a';
next;
}
# print "$_ matches '$first'?\n";
if($_ =~ /^$first(\S)/) {
if($prev ne 'a') {
show();
push @a, " ";
}
push @a, $_;
$prev='a';
}
else {
if($prev ne 'p') {
show();
}
if(@p) {
# if we have data, we fix blank lines
$_ =~ s/^\s*$/\ \n/g; # empty lines are nbsp
push @p, $_; # add it
}
elsif($_ !~ /^\s*$/) {
# this is not a blank line, add it
push @p, $_;
}
$prev = 'p';
}
}