Changeset 1231


Ignore:
Timestamp:
2000-06-23T11:54:30+12:00 (24 years ago)
Author:
gwp
Message:

Bug fix on the H1 metadata option: if the file has no <H1> tag,
nothing is added.

File:
1 edited

Legend:

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

    r1230 r1231  
    418418        my $tmptext = $$textref;
    419419        $tmptext =~ s/\s+/ /gs;
    420         $tmptext =~ s/.*<H1[^>]*>//i;
    421         $tmptext =~ s/<\/H1[^>]*>.*//i;
    422         $tmptext =~ s/^\s+//;
    423         $tmptext =~ s/\s+$//;
    424         $doc_obj->add_utf8_metadata ($section, $field, $tmptext);
     420        if ($tmptext =~ /<H1[^>]*>/i) {
     421        $tmptext =~ s/.*<H1[^>]*>//i;
     422        $tmptext =~ s/<\/H1[^>]*>.*//i;
     423        $tmptext =~ s/^\s+//;
     424        $tmptext =~ s/\s+$//;
     425        $doc_obj->add_utf8_metadata ($section, $field, $tmptext);
     426        }
    425427        next;
    426428    }
Note: See TracChangeset for help on using the changeset viewer.