Changeset 2995 for trunk/gsdl


Ignore:
Timestamp:
2002-02-24T10:09:50+13:00 (22 years ago)
Author:
sjboddie
Message:

Fixed a bug preventing HTML headers from being removed correctly when using
the -description_tags HTMLPlug flag. <Section> tags will now be ignored if
they occur within the head of the document, they should all instead be
within the body.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/HTMLPlug.pm

    r2975 r2995  
    160160    if ($self->{'description_tags'}) {
    161161
     162    # remove the html header - note that doing this here means any
     163    # sections defined within the header will be lost (so all <Section>
     164    # tags must appear within the body of the HTML)
     165    $$textref =~ s/^.*?<body[^>]*>//is;
     166    $$textref =~ s/(<\/body[^>]*>|<\/html[^>]*>)//isg;
     167
    162168    my $opencom = '(?:<!--|&lt;!(?:&mdash;|&#151;|--))';
    163169    my $closecom = '(?:-->|(?:&mdash;|&#151;|--)&gt;)';
     
    233239   
    234240    } else {
     241
     242    # remove header and footer
     243    if (!$self->{'keep_head'} || $self->{'description_tags'}) {
     244        $$textref =~ s/^.*?<body[^>]*>//is;
     245        $$textref =~ s/(<\/body[^>]*>|<\/html[^>]*>)//isg;
     246    }
     247
    235248    # single section document
    236249    $self->process_section($textref, $base_dir, $file, $doc_obj, $cursection);
     
    245258    my $self = shift (@_);
    246259    my ($textref, $base_dir, $file, $doc_obj, $cursection) = @_;
    247 
    248     # remove header and footer
    249     if (!$self->{'keep_head'} || $self->{'description_tags'}) {
    250     $$textref =~ s/^.*?<body[^>]*>//is;
    251     $$textref =~ s/(<\/body[^>]*>|<\/html[^>]*>)//isg;
    252     }
    253260
    254261    # trap links
Note: See TracChangeset for help on using the changeset viewer.