CGI-Kwiki
view release on metacpan or search on metacpan
lib/CGI/Kwiki/Formatter.pm view on Meta::CPAN
$text .= "<li>$line";
}
for (1..$level) {
my $tag = pop @tag_stack;
$text .= "</$tag>\n";
}
$_ = $self->lists_format($text);
}
$_;
}
split m!(^[0\*]+ .*?\n)(?=(?:[^0\*]|$))!ms, $text;
}
sub lists_format {
my ($self, $text) = @_;
return $text;
}
sub paragraph {
my ($self, $text) = @_;
my $switch = 0;
return map {
unless ($switch++ % 2) {
$_ = $self->paragraph_format($_);
}
$_;
}
split m!(\n\s*\n)!ms, $text;
}
sub paragraph_format {
my ($self, $text) = @_;
return '' if $text =~ /^[\s\n]*$/;
return $text if $text =~ /^<(o|u)l>/i;
return "<p>\n$text\n</p>\n";
}
sub horizontal_line {
( run in 1.300 second using v1.01-cache-2.11-cpan-483215c6ad5 )