Skip Menu |

This queue is for tickets about the CPAN-Changes CPAN distribution.

Report information
The Basics
Id: 95736
Status: resolved
Priority: 0/
Queue: CPAN-Changes

People
Owner: Nobody in particular
Requestors: KENTNL [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.27
Fixed in: (no value)



Subject: Round tripping long URLs breaks URLs

I discovered today that long URLs get arbitrarily snapped at the wrap length by Text::Tabs+Wrap

I'm not yet sure if this is a bug there, or in how its being consumed.

I had a changes entry like:

 - https://gist.github.com/kentfredric/1ac2697f6d6a4112c798#file-5-010-analysis

And every time I gave it a parse / serialize run it became wrapped, funnily, as

2 lines, one ending with "-anal" and the next starting with "ysis"

 

Ok, I found a workaround.

Because Text::Wrap doesn't take the wrap configuration as a parameter, its easy to adjust its settings at a higer scope.

So in my utility I use for normalizing changes file, I have this code in it:

 

$Text::Wrap::break='[\x09\x20]';
$Text::Wrap::huge='overflow';

The first of these replaces the moronic default of '\s' with an explicit "tab or space" match, because "\s" matches 0xA0 ... which is a NONBREAKING SPACE.

And the second one prevents a hard-snap when a single token exceeds the wrap length.

I've fixed this for the next release.
Fixed in 0.400001