| Next: HTML::Linkize | Previous: HTML::Balance | [Table of Contents] |
HTML::BreakupText - Perl extension for adding whitespace to HTML text.
#!/usr/bin/perl -w
use HTML::BreakupText;
use strict;
my $html = q[<a href="http://foooooooooooooooo.com/">http://foooooooooooooooooooooooooooooo.com</a>];
my $formatter = HTML::BreakupText->new( width => 10 );
my $output = $formatter->BreakupText( $html );
If you wish to display user supplied HTML text you may well find yourself a victim of people submitting long, unbroken, strings of input.
This results in so-called "page widening".
This module is designed to prevent this from occurring by breaking up supplied content into space deliminated output. The module is clever enough to not modify HTML attribute values - only their text componants.
Create a new instance of this object.
Process the given text and optional hash of options. Return the modified text;
Steve Kemp
http://www.steve.org.uk/
Copyright (c) 2005 by Steve Kemp. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license.