Subject: | a '=back' without a '=over' creates malformed xml |
If a '=back' doesn't close a '=over', Pod::XML generates a lone
'</list>', which results in a badly formatted xml document. I've
attached a small patch that only print the '</list>' if it's closing a
'<list>'.
Subject: | buggy.pod |
=head1 How a =back can spoil the fun
The =back below will generate a lone '</list>'
=back
Subject: | Pod-XML.patch |
*** XML.pm Sat Jul 14 18:16:40 2007
--- patch/Pod/XML.pm Sat Jul 14 18:13:56 2007
***************
*** 239,244 ****
--- 239,245 ----
$parser->{closeitem} = 0;
}
+ $parser->{in_over}++;
$parser->xml_output ( "<list>\n" );
}
elsif ( $command eq "back" )
***************
*** 249,255 ****
$parser->{closeitem} = 0;
}
! $parser->xml_output ( "</list>\n" );
}
elsif ( $command eq "item" )
{
--- 250,259 ----
$parser->{closeitem} = 0;
}
! if ( $parser->{in_over} ) {
! $parser->{in_over}--;
! $parser->xml_output ( "</list>\n" );
! }
}
elsif ( $command eq "item" )
{