Subject: | data paragraphs in PODs are mangled on tidy |
Occasionally data paragraphs in PODs are mangled during a tidying run. This is due to how
the POD::Tidy module parses and cleans PODs in the codebase.
Long story short: Pod::Tidy should be ignoring everything in between =begin and =end, (data
paragraphs) and leaving them as-is instead of wrapping them, but it isn't.
AFAICT it is not looking at or detecting the existence of of those format blocks. I went
through the code of Pod::Tidy (which subclasses Pod::Wrap which subclasses Pod::Parser) and
in all three of those modules I couldn't find any special cases for data paragraphs. It seems
like it should be the responsibility of Pod::Wrap and Pod::Tidy to detect that a paragraph of
text is a data paragraph and not perform any tidying on it. But these modules are not
examining the parse tree or anything else beyond whether a paragraph is a verbatim or a
textblock. So what is happening is it is seeing chunks of text as textblocks (not double-
checking to see if they are data paragraphs) and wraps them even when it shouldn't.
We discovered this because we had sample pieces of JSON in our own =begin and =end data
blocks which were then reformatted during a tidy run.
http://perldoc.perl.org/perlpodspec.html#About-Data-Paragraphs-and-
%22%3dbegin%2f%3dend%22-Regions
"Data paragraphs are typically used for inlining non-Pod data that is to be used (typically
passed through) when rendering the document to a specific format"