Skip Menu |

This queue is for tickets about the Pod-DocBook CPAN distribution.

Report information
The Basics
Id: 20941
Status: open
Priority: 0/
Queue: Pod-DocBook

People
Owner: Nobody in particular
Requestors: PJF [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.2
Fixed in: (no value)



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.
RT-Send-CC: nandu [...] zvolve.com
My previous patch still had Pod::DocBook make a state transition even if it did not recognise the =for block. The attached patch fixes this, and unknown =for blocks are now completely ignored. It may be sensible not to have a transition change when a '=for docbook' section is found, as this will drop us out of itemised lists and other formatting. However I haven't been bitten by that yet. ;)
Index: lib/Pod/DocBook.pm =================================================================== RCS file: /var/cvs/pod-docbook/lib/Pod/DocBook.pm,v retrieving revision 1.8 diff -u -r1.8 DocBook.pm --- lib/Pod/DocBook.pm 19 Jul 2006 02:33:58 -0000 1.8 +++ lib/Pod/DocBook.pm 11 Aug 2006 06:58:37 -0000 @@ -97,12 +97,15 @@ # docbook markup will get mangled. if ($command eq 'for') { - $parser->_transition ('for'); if ($paragraph =~ /^(:\S+|docbook)/) { + $parser->_transition ('for'); $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 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- t/for.pod 28 Sep 2005 02:05:00 -0000 1.1 +++ t/for.pod 11 Aug 2006 05:30:46 -0000 1.2 @@ -1 +1,3 @@ =for docbook <emphasis>This is important.</emphasis> + +=for TODO This should be ignored.