Text-KwikiFormatish

 view release on metacpan or  search on metacpan

lib/Text/KwikiFormatish.pm  view on Meta::CPAN

                $text .= "<li>$line</li>";
            }
            for ( 1 .. $level ) {
                my $tag = pop @tag_stack;
                $text .= "</$tag>\n";
            }
            $_ = $self->lists_format($text);
        }
        $_;
        }
        split m!(^[0\*]+ .*?\n)(?=(?:[^0\*]|$))!ms, $text;
}

=item * lists_format - how to format the lists

=cut

sub lists_format {
    my ( $self, $text ) = @_;
    return $text;
}

lib/Text/KwikiFormatish.pm  view on Meta::CPAN

sub paragraph {
    my ( $self, $text ) = @_;
    my $switch = 0;
    return map {
        unless ( $switch++ % 2 )
        {
            $_ = $self->paragraph_format($_);
        }
        $_;
        }
        split m!(\n\s*\n)!ms, $text;
}

=item * paragraph_format - how to format paragraphs as XHTML

=cut

sub paragraph_format {
    my ( $self, $text ) = @_;
    return ''    if $text =~ /^[\s\n]*$/;
    return $text if $text =~ /^<(o|u)l>/i;



( run in 1.234 second using v1.01-cache-2.11-cpan-5511b514fd6 )