HTML-CruftText
view release on metacpan or search on metacpan
lib/HTML/CruftText.pm view on Meta::CPAN
$data =~ s/$_process_html_comment_regex_brackets/|/g;
# Prepend every line with comment (not precompiled because trivial)
$data =~ s/\n/ -->\n<!-- /gs;
return $data;
}
# remove >'s from inside comments so the simple line density scorer
# doesn't get confused about where tags end.
# also, split multiline comments into multiple single line comments
my $_remove_tags_in_comments_regex_html_comment = qr/<!--(.*?)-->/ios;
sub _remove_tags_in_comments($)
{
my $lines = shift;
my $html = join("\n", @{ $lines });
# Remove ">" and "<" in comments
$html =~ s/$_remove_tags_in_comments_regex_html_comment/'<!--'._process_html_comment($1).'-->'/eg;
( run in 0.472 second using v1.01-cache-2.11-cpan-71847e10f99 )