Bug#941980: pod2man: Please convert zero-width space (u200B) to \:

Russ Allbery rra at debian.org
Tue Oct 8 22:12:50 BST 2019


Jean-Michel Vourgère <nirgal at debian.org> writes:

> I'm using pod to generate man files in package rrdtool.

> I had an issue with long man lines such as:
> B<DEF:>I<E<lt>vnameE<gt>>=I<E<lt>rrdfileE<gt>>:I<E<lt>ds-nameE<gt>>:I<E<lt>CFE<gt>>[:step=I<E<lt>stepE<gt>>][:start=I<E<lt>timeE<gt>>][:end=I<E<lt>timeE<gt>>][:reduce=I<E<lt>B<CF>E<gt>>][:daemon=I<E<lt>addressE<gt>>]
> that results lintian "manpage-has-errors-from-man": can't break line.

> That I fixed that by inserting unicode zero-width-space characters 200B:
> B<DEF:>I<E<lt>vnameE<gt>>=I<E<lt>rrdfileE<gt>>:I<E<lt>ds-nameE<gt>>:I<E<lt>CFE<gt>>[:step=I<E<lt>stepE<gt>>][:start=I<E<lt>timeE<gt>>]E<0x200B>[:end=I<E<lt>timeE<gt>>]E<0x200B>[:reduce=I<E<lt>B<CF>E<gt>>]E<0x200B>[:daemon=I<E<lt>addressE<gt>>]

> I expected pod2man to generate the corect \: escape sequence, but it
> did not.

> Right now, as a work around, I'm using in my make file:
> pod2man ... --utf8 $< | sed -e $$'s|\u200B|\\\\:|g' > $@

> This is working great.

> However, it would be nice if pod2man would generate automatically the \:
> escape sequences, so that I don't have to sed the output!

Unfortunately, \: appears to be a groff extension as far as I can tell.
It's at least not mentioned in CSTR 54, nor in other older documentation I
can find for the *roff language.  That means this gets entangled in the
general design constraint that pod2man tries to produce portable *roff
output that's not specific to groff.

I'm not certain this is fully correct because unfortunately it's very
difficult to search for \: to get more data.

Sadly, \& doesn't seem to work here; if it did, this would be easy to fix
in pod2man.

I'll have to think about this a bit and ponder what the best approach
would be.  I'm still considering whether the time has come to just assume
that the output formatter is almost certainly going to be groff or
something compatible with groff and start using more groff-specific logic
(such as assuming that the formatter can handle Unicode output).

-- 
Russ Allbery (rra at debian.org)               <http://www.eyrie.org/~eagle/>




More information about the Perl-maintainers mailing list