package WebGUI::HTML; =head1 LEGAL ------------------------------------------------------------------- WebGUI is Copyright 2001-2004 Plain Black LLC. ------------------------------------------------------------------- Please read the legal notices (docs/legal.txt) and the license (docs/license.txt) that came with this distribution before using this software. ------------------------------------------------------------------- http://www.plainblack.com info@plainblack.com ------------------------------------------------------------------- =cut use HTML::TagFilter; use strict; use WebGUI::Macro; use WebGUI::Session; use WebGUI::SQL; =head1 NAME Package WebGUI::HTML =head1 DESCRIPTION A package for manipulating and massaging HTML. =head1 SYNOPSIS use WebGUI::HTML; $html = WebGUI::HTML::cleanSegment($html); $html = WebGUI::HTML::filter($html); $html = WebGUI::HTML::format($content, $contentType); $html = WebGUI::HTML::processReplacements($html); =head1 METHODS These methods are available from this package: =cut #------------------------------------------------------------------- =head2 cleanSegment ( html ) Returns an HTML segment that has been stripped of the
tag and anything before it, as well as the tag and anything after it. It's main purpose is to get rid of META tags and other garbage from an HTML page that will be used as a segment inside of another page. NOTE: This filter does have one exception, it leaves anything before the tag that is enclosed in or tags. =over =item html The HTML segment you want cleaned. =back =cut sub cleanSegment { my $value = $_[0]; if ($value =~ s/\r/\n/g) { $value =~ s/\n\n/\n/g } $value =~ m/(\