| 1 | package Text::Livedoor::Wiki::Plugin::Block::Pre; | ||||||||||
| 2 | |||||||||||
| 3 | 5 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 5 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 5 | ▶ | use base qw(Text::Livedoor::Wiki::Plugin::Block); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 144 | ▶ | sub check { | ||||||||
|
Subroutine
check: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 8 | 144 | my $self = shift; | |||||||||
| 9 | 144 | my $line = shift; | |||||||||
| 10 | 144 | my $args = shift; | |||||||||
| 11 | 144 | my $on_next = $args->{on_next}; | |||||||||
| 12 | |||||||||||
| 13 | 144 | ▶ | if( $line =~ /^\^/ ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | 9 | ▶ | $line =~ s/^\^// unless $on_next;; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 15 | 9 | return { line => $line . "\n" }; | |||||||||
| 16 | } | ||||||||||
| 17 | 135 | return; | |||||||||
| 18 | |||||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | 3 | ▶ | sub get { | ||||||||
|
Subroutine
get: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 22 | 3 | my $self = shift; | |||||||||
| 23 | 3 | my $block = shift; | |||||||||
| 24 | 3 | my $inline = shift; | |||||||||
| 25 | 3 | my $items = shift; | |||||||||
| 26 | 3 | my $html = ''; | |||||||||
| 27 | 3 | $html .= $inline->parse( $_->{line} ) . "\n" for @$items; | |||||||||
| 28 | 3 | return "<pre>\n$html</pre>\n"; | |||||||||
| 29 | |||||||||||
| 30 | } | ||||||||||
| 31 | 5 | 1; | |||||||||
| 32 | |||||||||||
| 33 | =head1 NAME | ||||||||||
| 34 | |||||||||||
| 35 | Text::Livedoor::Wiki::Plugin::Block::Pre - Pre Block Plugin | ||||||||||
| 36 | |||||||||||
| 37 | =head1 DESCRIPTION | ||||||||||
| 38 | |||||||||||
| 39 | pre-formatted text | ||||||||||
| 40 | |||||||||||
| 41 | =head1 SYNOPSIS | ||||||||||
| 42 | |||||||||||
| 43 | ^ PRE | ||||||||||
| 44 | ^ pre block | ||||||||||
| 45 | |||||||||||
| 46 | =head1 FUNCTION | ||||||||||
| 47 | |||||||||||
| 48 | =head2 check | ||||||||||
| 49 | |||||||||||
| 50 | =head2 get | ||||||||||
| 51 | |||||||||||
| 52 | =head1 AUTHOR | ||||||||||
| 53 | |||||||||||
| 54 | polocky | ||||||||||
| 55 | |||||||||||
| 56 | =cut | ||||||||||