Reviews by mirod

cpanratings
 

RSS

Digest-MD5 (2.51) *****

Easy to use (I use the function interface). I found the docs very helpful when I run into problems with unicode strings. Great module.

mirod - 2011-06-15T00:48:36 (permalink)

3 out of 3 found this review helpful. Was this review helpful to you?  Yes No

HTML-Tidy (1.54) ****

I use HTML::Tidy to convert HTML to XHTML, since at the moment it's the best tool for this job.

I found HTML::Tidy a bit of a pain to install, but once that's done it works seamlessly.

Here is the how I do the conversion:

sub _tidy_html

{ my( $html, $options)= @_;

my $TIDY_DEFAULTS= { output_xhtml => 1, # duh!

tidy_mark => 0, # do not add the "generated by tidy" comment

numeric_entities => 1,

char_encoding => 'utf8',

bare => 1,

clean => 1,

doctype => 'transitional',

fix_backslash => 1,

merge_divs => 0,

merge_spans => 0,

sort_attributes => 'alpha',

indent => 0,

wrap => 0,

break_before_br => 0,

};

$options ||= {};

my $tidy_options= { %$TIDY_DEFAULTS, %$options};

my $tidy = HTML::Tidy->new( $tidy_options);

# not clean, but any remaining error will be caught by the XML parsing

$tidy->ignore( type => 1, type => 2 ); # 1 is TIDY_WARNING, 2 is TIDY_ERROR

my $xml= $tidy->clean( $html );

return $xml;

}

mirod - 2011-03-25T23:54:24 (permalink)

3 out of 3 found this review helpful. Was this review helpful to you?  Yes No