develooper Front page | perl.pod-people | Postings from April 2016

Pod::Simple issues

Thread Next
From:
Karl Williamson
Date:
April 29, 2016 19:34
Subject:
Pod::Simple issues
Message ID:
5723B73D.4060102@khwilliamson.com
I stumbled across a bug in Pod::Simple the other day: It does not create 
the promised {'raw'} structure element usable by parsers for L<> 
constructs if they occur within another formatting code, such as the 
fairly common C<L<foo::bar>>.

I figured out a way to fix this, but in doing so I realized that 
Pod::Simple does not catch nested L<... L<...>...>, contrary to the 
specification:

  Authors must not nest L<...> codes. For example, "L<The L<Foo::Bar>
          man page>" should be treated as an error.

Pod::Simple does not treat this as an error.  I think it should.  Is 
there any disagreement?

Rather than aborting parsing at the point where this occurs, I think it 
should continue on, but generate an errors section, like it does for 
most other errors.  Properly handling nested L<> is tricky.  Currently, 
it sort of works, but the generated output for html doesn't link 
properly, as one can't nest links in html.  I came up with this 
tentative message, which perhaps explains too much of how I was able to 
easily keep parsing with this error, and still fix the original {'raw'} 
bug; improved wording welcome:

   Nested L<> are illegal.  Pretending inner one is X<> so can continue 
looking for other errors.


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About