rjbs / Pod-Weaver

recombine pod documents into awesomer pod documents
26 stars 28 forks source link

inappropriate wordwrapping in [Bugs] #36

Closed karenetheridge closed 9 years ago

karenetheridge commented 9 years ago

Seen in Dist-Zilla-Plugin-Test-PodSpelling commit efc99e67e (first commit after the v2.006008 tag) -- the BUGS section being added is this:

=head1 BUGS

Please report any bugs or feature requests on the bugtracker website
https://rt.cpan.org/Public/Dist/Display.html?Name=Dist-Zilla-Plugin-Test-Po
dSpelling or by email to
bug-Dist-Zilla-Plugin-Test-PodSpelling@rt.cpan.org.

When submitting a bug or request, please include a test-file or a
patch to an existing test-file that illustrates the bug or desired
feature.

Note the bizarre linebreak being inserted in the middle of the RT link.

I don't see anything else in the config that could be responsible for this. Weird!

karenetheridge commented 9 years ago

I'm trying to reproduce this in another distribution and I can't... I will keep poking to narrow this down.

karenetheridge commented 9 years ago

Scratch that -- I've reproduced it.

Here's the repro case:

use strict;
use warnings;

use Test::More;
use Test::DZil;
use Path::Tiny;

my $bug_url = 'https://rt.cpan.org/Public/Dist/Display.html?Name=Dist-Zilla-Plugin-Test-PodSpelling';

my $tzil = Builder->from_config(
    { dist_root => 't/does_not_exist' },
    {
        add_files => {
            path(qw(source dist.ini)) => simple_ini(
                'GatherDir',
                'PodWeaver',
                [ 'MetaResources' => {
                    'bugtracker.mail' => 'bug-Dist-Zilla-Plugin-Test-PodSpelling@rt.cpan.org',
                    'bugtracker.web' => $bug_url,
                  } ],
            ),
            path(qw(source lib Foo.pm)) => "package Foo;\n1",
            path(qw(source weaver.ini)) => "[\@Default]\n[Bugs]\n",
        },
    },
);

$tzil->build;

my $module = $tzil->slurp_file('build/lib/Foo.pm');
like($module, qr/$bug_url/, 'found bug url, unbroken, in the woven pod');

done_testing;
kentfredric commented 9 years ago

Text::Wrap:

When words that are longer than $columns are encountered, they are broken up. "wrap()" adds a "\n" at column $columns. This behavior can be overridden by setting $huge to 'die' or to 'overflow'. When set to 'die', large words will cause "die()" to be called. When set to 'overflow', large words will be left intact.