| 1 | ############################################################################# | ||||||||||||||||||||||||||||
| 2 | # (c) by Tels 2004. Part of Convert::Wiki | ||||||||||||||||||||||||||||
| 3 | # | ||||||||||||||||||||||||||||
| 4 | # represents an item in a list (aka <li> or *) | ||||||||||||||||||||||||||||
| 5 | ############################################################################# | ||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | package Convert::Wiki::Node::Item; | ||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 4 | ▶ | use 5.006001; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 4 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 4 | ▶ | use Convert::Wiki::Node; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 4 | ▶ | use vars qw/$VERSION @ISA/; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 4 | @ISA = qw/Convert::Wiki::Node/; | |||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 4 | $VERSION = '0.03'; | |||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | ############################################################################# | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | sub _as_wiki | ||||||||||||||||||||||||||||
| 24 | 8 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
_as_wiki: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||
| 25 | 8 | my ($self,$txt) = @_; | |||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | # "* Foo bar is baz.\n" | ||||||||||||||||||||||||||||
| 28 | 8 | my $trailing = "\n"; | |||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | # add a new line if the next node is not an item | ||||||||||||||||||||||||||||
| 31 | 8 | my $next = $self->{next}; | |||||||||||||||||||||||||||
| 32 | 8 | ▶ | $trailing .= "\n" if defined $next && $next->type() ne 'item'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $next and $next->type ne "item"
MC/DC100%2/2
defined $next and $next->type ne "item"
defined $next
$next->type ne "item"
Truth table100%3/3
A and B
A= defined $nextB= $next->type ne "item"
| |||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 8 | '* ' . $txt . $trailing; | |||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 4 | 1; | |||||||||||||||||||||||||||
| 38 | __END__ | ||||||||||||||||||||||||||||