Subject: | Pod::Docbook 1.2 does not ignore unrecognised =for blocks |
Pod::DocBook 1.2 does not ignore unrecognised =for sections, and instead
treats them as errors. This can result in broken output when POD is
written for multiple output formats.
The attached patch fixes this behaviour, and adjusts the test suite
appropriately.
Subject: | for.patch |
Index: lib/Pod/DocBook.pm
===================================================================
RCS file: /var/cvs/pod-docbook/lib/Pod/DocBook.pm,v
retrieving revision 1.9
diff -u -r1.9 DocBook.pm
--- lib/Pod/DocBook.pm 19 Jul 2006 08:55:47 -0000 1.9
+++ lib/Pod/DocBook.pm 11 Aug 2006 05:19:58 -0000
@@ -101,8 +101,11 @@
if ($paragraph =~ /^(:\S+|docbook)/) {
$paragraph =~ s/$1\s+//;
print $out_fh $paragraph, "\n";
- return;
}
+ # If we've processed a docbook 'for', then we're done.
+ # If we've process any other 'for', then it wasn't
+ # intended for us, and we're also done.
+ return;
}
# Now escape SGML-escape our text, and figure out what to do
Index: t/for.pod
===================================================================
RCS file: /var/cvs/pod-docbook/t/for.pod,v
retrieving revision 1.1
diff -u -r1.1 for.pod
--- t/for.pod 28 Sep 2005 02:05:00 -0000 1.1
+++ t/for.pod 11 Aug 2006 05:18:24 -0000
@@ -1 +1,3 @@
=for docbook <emphasis>This is important.</emphasis>
+
+=for TODO This should be ignored.