lib/Kwiki/ParagraphBlocks.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 1 | 3 | 33.3 |
branch | n/a | ||
condition | n/a | ||
subroutine | 1 | 1 | 100.0 |
pod | n/a | ||
total | 2 | 4 | 50.0 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Kwiki::ParagraphBlocks; | ||||||
2 | 1 | 1 | 33982 | use Kwiki::Plugin -Base; | |||
0 | |||||||
0 | |||||||
3 | our $VERSION = '0.12'; | ||||||
4 | |||||||
5 | const class_id => 'paragraph_blocks'; | ||||||
6 | const class_title => 'Paragraph Blocks'; | ||||||
7 | |||||||
8 | sub register { | ||||||
9 | my $registry = shift; | ||||||
10 | $registry->add(wafl => p => 'Kwiki::ParagraphBlocks::Wafl'); | ||||||
11 | } | ||||||
12 | |||||||
13 | package Kwiki::ParagraphBlocks::Wafl; | ||||||
14 | use base 'Spoon::Formatter::WaflBlock'; | ||||||
15 | |||||||
16 | sub to_html { | ||||||
17 | my $block = Kwiki::Formatter::Paragraph->new( | ||||||
18 | hub => $self->hub, | ||||||
19 | text => $self->block_text, | ||||||
20 | ); | ||||||
21 | $block->parse_phrases; | ||||||
22 | my $html = $block->to_html; | ||||||
23 | $html =~ s/.*? |
||||||
24 | $html =~ s/\n/ \n/g; |
||||||
25 | $html =~ s/^( +)/' ' x length($1)/gem; | ||||||
26 | return " \n$html "; |
||||||
27 | } | ||||||
28 | |||||||
29 | __DATA__ |