User:AnomieBOT/source/tasks/SourceUploader/WikiPod.pm

',       ' '  => " \n", ' ' => "\n \n", };

bless $self, $class; return $self; }

sub _start_A { my $self=shift; $self->_append(''); $self->_output; # Flush text buffer }
 * 1) New "A<>" code handling

sub _end_A { my $self=shift; my $link="$self->{_A_base}/$self->{_wiki_text}"; if($link=~/::/){ $link=~s!::!/!g; $link.='.pm'; }   $self->{_wiki_text} = "$self->{_wiki_text}"; }

sub _indent_item { my $self=shift; my $item_type   = $_[0]; my $item_param  = $_[1]; my $indent_level = $self->{_item_indent};
 * 1) Fix indentation and multiple =items with no intervening paragraph.

$self->_append(':' x ($indent_level-1)); if ($item_type eq 'bullet') { $self->_append('* '); } elsif ($item_type eq 'number') { $self->_append('# '); } elsif ($item_type eq 'text') { $self->_append('; '); } }

sub _end_item_text {$_[0]->_output("\n")}

sub _start_Para { my $self        = shift; my $indent_level = $self->{_item_indent};

if ($self->{_in_over_block}) { $self->{_indent_text} = (':' x $indent_level); }

if ($self->{_in_over_text}) { # This line is the only difference from Pod::Simple::Wiki::Mediawiki $self->{_indent_text} = (':' x $indent_level); } }

sub _format_link { my ($self, $text, $attr) = @_;
 * 1) Fix link formatting

if ($attr->{type} eq 'url') { my $link = $attr->{to}; if($link=~m(^(?:https?|ftp|irc|mailto|svn|git)://)){ return $link if $attr->{'content-implicit'}; return "[$link $text]"; } else { $link=~s/_/ /g; ($text=$link)=~s/^[^:]*:// if $attr->{'content-implicit'}; return "$text"; }   }

if ($attr->{type} eq 'man') { if($attr->{to}=~/^(.+)\(([^)]+)\)$/){           my ($page,$section)=($1,$2);            my $src=;            $src='perldoc' if $page=~/^perl/i || $section eq '3perl';            return "" if(!defined($attr->{section}) && $attr->{'content-implicit'});            $src='default' if $src eq ;            my $link="";            $link.="#".$attr->{section} if defined $attr->{section};            return "" if $attr->{'content-implicit'};            return "[$link $text]";        }    }

die "Unknown link type $attr->{type}" unless $attr->{type} eq 'pod';

# Handle a link within this page: return "$text" unless defined $attr->{to};

# Handle a link to a specific section in another page: return "$text" if defined $attr->{section};

return "$attr->{to}" if $attr->{'content-implicit'};

return "$text"; }

1;