App-ArticleWrap
view release on metacpan or search on metacpan
script/article-wrap view on Meta::CPAN
the top but do wrap the rest of the file. Also don't wrap "source code" which is
fenced by Markdown code fences: trible backticks. Don't wrap short lines (10
characters or less). Don't wrap lines with whitespace at the end. Don't wrap
empty lines.
This is useful when post-processing a message written using ed for posting using
tin, for example.
=cut
use Modern::Perl;
die "This filter wraps news posts.\n" if @ARGV;
binmode(STDIN, ':utf8');
binmode(STDOUT, ':utf8');
# headers
while (<STDIN>) {
chomp;
last if not $_; # end of headers
say; # header line
}
print "\n"; # empty line after headers
my $max = 72;
my $buffer;
my $prefix = '';
( run in 0.491 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )