From 328b8d1d91a5510a429ae220107e89407c5b809c Mon Sep 17 00:00:00 2001 From: Marc Green Date: Thu, 4 Aug 2011 13:27:32 -0400 Subject: [PATCH] Change empty =over/=back block to have list_type "empty" instead of "block". --- lib/Pod/Simple/BlackBox.pm | 2 +- lib/Pod/Simple/Subclassing.pod | 47 +++++++++++++++++++++++++++++----- t/emptylists.t | 2 +- 3 files changed, 43 insertions(+), 8 deletions(-) diff --git a/lib/Pod/Simple/BlackBox.pm b/lib/Pod/Simple/BlackBox.pm index bdef07aa..4b4b0866 100644 --- a/lib/Pod/Simple/BlackBox.pm +++ b/lib/Pod/Simple/BlackBox.pm @@ -1118,7 +1118,7 @@ sub _ponder_over { } elsif($paras->[0][0] eq '=back') { # Ignore empty lists by default if ($self->{'parse_empty_lists'}) { - $list_type = 'block'; # Not sure what else it would be + $list_type = 'empty'; } else { shift @$paras; return 1; diff --git a/lib/Pod/Simple/Subclassing.pod b/lib/Pod/Simple/Subclassing.pod index 399d5e97..db7bbb38 100644 --- a/lib/Pod/Simple/Subclassing.pod +++ b/lib/Pod/Simple/Subclassing.pod @@ -490,7 +490,7 @@ message might be issued to the user. =item events with an element_name of over-text -These events are are somewhat unlike the other over-* +These events are somewhat unlike the other over-* structures, as far as what their contents are. When an "=over ... Z<>=back" block is parsed where the items are a list of text "subheadings", it will produce this event structure: @@ -545,7 +545,7 @@ produces this event structure: =item events with an element_name of over-block -These events are are somewhat unlike the other over-* +These events are somewhat unlike the other over-* structures, as far as what their contents are. When an "=over ... Z<>=back" block is parsed where there are no items, it will produce this event structure: @@ -569,7 +569,7 @@ For example, this Pod source: circumstances of cruelty and perfidy scarcely paralleled in the most barbarous ages, and totally unworthy the head of a civilized nation. - =cut + =back will produce this event structure: @@ -585,6 +585,42 @@ will produce this event structure: +=item events with an element_name of over-empty + +B is set to a +true value.> + +These events are somewhat unlike the other over-* +structures, as far as what their contents are. When +an "=over ... Z<>=back" block is parsed where there is no content, +it will produce this event structure: + + + + +The I attribute is as with the other over-* events. + +For example, this Pod source: + + =over + + =over + + =back + + =back + +will produce this event structure: + + + + + + +Note that the outer C<=over> is a block because it has no C<=item>s but still +has content: the inner C<=over>. The inner C<=over>, in turn, is completely +empty, and is treated as such. + =item events with an element_name of item-bullet See L, above. @@ -857,9 +893,8 @@ significant (such as text or *roff, but not HTML). =item C<< $parser->parse_empty_lists( I ) >> If this attribute is set to true, the parser will not ignore empty -C<=over>/C<=back> blocks. The type of C<=over> will be I. - -=back +C<=over>/C<=back> blocks. The type of C<=over> will be I, documented +above, L. =head1 SEE ALSO diff --git a/t/emptylists.t b/t/emptylists.t index 5cf027d3..619cd63b 100644 --- a/t/emptylists.t +++ b/t/emptylists.t @@ -60,7 +60,7 @@ ok( $x->_out(\&off, $pod), print "# Testing parse_empty_lists( TRUE ) ...\n"; ok( $x->_out(\&on, $pod), - '' + '' ); print "# Wrapping up... one for the road...\n";