| 1 | package Text::Livedoor::Wiki::Plugin::Block::Blockquote; | ||||||||||
| 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 | 249 | ▶ | sub check { | ||||||||
|
Subroutine
check: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 8 | 249 | my $class = shift; | |||||||||
| 9 | 249 | my $line = shift; | |||||||||
| 10 | 249 | my $args = shift; | |||||||||
| 11 | 249 | my $id = $args->{id}; | |||||||||
| 12 | 249 | my $on_next = $args->{on_next}; | |||||||||
| 13 | 249 | ▶ | if( $line =~ /^[ \t>]/ ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | 21 | ▶ | $line =~ s/^[ \t>]// unless $on_next;; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 15 | 21 | return { id => $id , line => $line . "\n" }; | |||||||||
| 16 | } | ||||||||||
| 17 | 228 | return; | |||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | 5 | ▶ | sub get { | ||||||||
|
Subroutine
get: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 21 | 5 | my $class = shift; | |||||||||
| 22 | 5 | my $block = shift; | |||||||||
| 23 | 5 | my $inline = shift; | |||||||||
| 24 | 5 | my $items = shift; | |||||||||
| 25 | 5 | my $id = $items->[0]{id}; | |||||||||
| 26 | 5 | my $text = ''; | |||||||||
| 27 | 5 | $text .= $_->{line} for @$items; | |||||||||
| 28 | 5 | my $html = $inline->parse($text); | |||||||||
| 29 | 5 | return qq|<blockquote id="$id">\n$html\n</blockquote>\n|; | |||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | 5 | 1; | |||||||||
| 33 | |||||||||||
| 34 | =head1 NAME | ||||||||||
| 35 | |||||||||||
| 36 | Text::Livedoor::Wiki::Plugin::Block::Blockquote - Blockquote Block Plugin | ||||||||||
| 37 | |||||||||||
| 38 | =head1 DESCRIPTION | ||||||||||
| 39 | |||||||||||
| 40 | surround text with blockquote tag | ||||||||||
| 41 | |||||||||||
| 42 | =head1 SYNOPSIS | ||||||||||
| 43 | |||||||||||
| 44 | > block text | ||||||||||
| 45 | > here here here | ||||||||||
| 46 | > hi mom! | ||||||||||
| 47 | > you can use space instead of > or TAB if you want. | ||||||||||
| 48 | |||||||||||
| 49 | =head1 FUNCTION | ||||||||||
| 50 | |||||||||||
| 51 | =head2 check | ||||||||||
| 52 | |||||||||||
| 53 | =head2 get | ||||||||||
| 54 | |||||||||||
| 55 | =head1 AUTHOR | ||||||||||
| 56 | |||||||||||
| 57 | polocky | ||||||||||
| 58 | |||||||||||
| 59 | =cut | ||||||||||