Pod::Simple issues

[email protected] (Karl Williamson) Fri, 29 Apr 2016 13:34:21 -0600
Newsgroups perl.pod-people
Message-ID <[email protected]>
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.