Skip Menu |
 

This queue is for tickets about the HTML-Format CPAN distribution.

Report information
The Basics
Id: 88478
Status: new
Priority: 0/
Queue: HTML-Format

People
Owner: Nobody in particular
Requestors: user42 [...] zip.com.au
Cc:
AdminCc:

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



Subject: leading space when body no <p>
Date: Sat, 07 Sep 2013 11:52:16 +1000
To: bug-HTML-Format [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
Download (untitled) / with headers
text/plain 539b
With recent debian i386 perl 5.14.2 and HTML::FormatText 2.10, the program foo.pl below prints Formatted to: " This is some text. " where I hoped that it would not have the leading space, so instead Formatted to: "This is some text. " The latter is what you get if there's a <p> in the html (with or without whitespace between it and the text). I struck this when applying HTML::FormatText to some sloppy html which lacked proper <p> paragraph around its text. It'd be good if HTML::FormatText was forgiving of that sort of thing.
Download foo.pl
text/x-perl 340b
#!/usr/bin/perl -w use strict; use HTML::FormatText; my $html = " <html> <body> This is some text. </body> </html>"; my $str = HTML::FormatText->format_string ($html, leftmargin => 0, rightmargin => 40); print "Formatted to: \"$str\"\n"; exit 0;


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.