cvs commit: www/scripts manage_news.pl

lizardo at linuxfromscratch.org lizardo at linuxfromscratch.org
Fri Nov 28 08:26:57 PST 2003


lizardo     03/11/28 09:26:57

  Modified:    scripts  manage_news.pl
  Log:
  manage_news.pl: Fixed a problem with parsing empty element tags.
  
  Revision  Changes    Path
  1.24      +4 -4      www/scripts/manage_news.pl
  
  Index: manage_news.pl
  ===================================================================
  RCS file: /home/cvsroot/www/scripts/manage_news.pl,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- manage_news.pl	27 Nov 2003 00:59:28 -0000	1.23
  +++ manage_news.pl	28 Nov 2003 16:26:57 -0000	1.24
  @@ -17,7 +17,7 @@
   # along with this program; if not, write to the Free Software
   # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
   
  -# $Id: manage_news.pl,v 1.23 2003/11/27 00:59:28 jeroen Exp $
  +# $Id: manage_news.pl,v 1.24 2003/11/28 16:26:57 lizardo Exp $
   
   use strict;
   use warnings;
  @@ -100,7 +100,7 @@
   
       my $html_p = HTML::Parser->new(api_version => 3,
           start_h => [\&handle_StartTag, "tagname, attr"],
  -        end_h => [\&handle_EndTag, "tagname"],
  +        end_h => [\&handle_EndTag, "tagname, tokenpos"],
           text_h => [\&handle_Text, "dtext" ],
           declaration_h => [\&handle_Dec, "text"],
       );
  @@ -218,9 +218,9 @@
   }
   
   sub handle_EndTag {
  -    my ($tag) = @_;
  +    my ($tag, $tokenpos) = @_;
       
  -    if ($buffer =~ /<$tag[^>]*>$/) {
  +    if ($buffer =~ /<$tag[^>]*>$/ and !defined($tokenpos)) {
           $buffer =~ s/>$/ \/>/;
       }
       else {
  
  
  



More information about the website mailing list