Convert::Wiki::Node::Item - Represents an item in a list (aka <li> or *)


Convert-Wiki documentation Contained in the Convert-Wiki distribution.

Index


Code Index:

NAME

Top

Convert::Wiki::Node::Item - Represents an item in a list (aka <li> or *)

SYNOPSIS

Top

	use Convert::Wiki::Node::Item;

	my $para = Convert::Wiki::Node->new( txt => 'Foo is a foobar.', type => 'item' );

	print $para->as_wiki();		# print something like "* Foo is a foorbar\n"

DESCRIPTION

Top

A Convert::Wiki::Node::Item represents an item in a list (aka the equivalent of <li> or *.

EXPORT

Top

None by default.

SEE ALSO

Top

Convert::Wiki::Node.

AUTHOR

Top

Tels http://bloodgate.com

COPYRIGHT AND LICENSE

Top


Convert-Wiki documentation Contained in the Convert-Wiki distribution.

#############################################################################
# (c) by Tels 2004. Part of Convert::Wiki
#
# represents an item in a list (aka <li> or *)
#############################################################################

package Convert::Wiki::Node::Item;

use 5.006001;
use strict;
use warnings;

use Convert::Wiki::Node;

use vars qw/$VERSION @ISA/;

@ISA = qw/Convert::Wiki::Node/;

$VERSION = '0.03';

#############################################################################

sub _as_wiki
  {
  my ($self,$txt) = @_;

  # "* Foo bar is baz.\n"
  my $trailing = "\n";

  # add a new line if the next node is not an item
  my $next = $self->{next};
  $trailing .= "\n" if defined $next && $next->type() ne 'item';

  '* ' . $txt . $trailing;
  }

1;
__END__