Changeset 4821


Ignore:
Timestamp:
2003-06-26T17:25:24+12:00 (21 years ago)
Author:
jrm21
Message:

corrected extract_first_NNNN function so that it doesn't get confused by

characters in javascript code

File:
1 edited

Legend:

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

    r4785 r4821  
    575575    foreach my $size (split /,/, $self->{'first'}) {
    576576    my $tmptext =  $$textref;
     577    # skip to the body
    577578    $tmptext =~ s/.*<body[^>]*>//i;
    578     $tmptext =~ s/$self->{'title_sub'}// if ($self->{'title_sub'});
     579    # remove javascript
     580    $tmptext =~ s@<script.*?</script>@ @sig;
    579581    $tmptext =~ s/<[^>]*>/ /g;
    580582    $tmptext =~ s/&nbsp;/ /g;
     
    583585    $tmptext =~ s/\s+/ /gs;
    584586    $tmptext = substr ($tmptext, 0, $size);
    585     $tmptext =~ s/\s\S*$/&#8230;/;
     587    $tmptext =~ s/\s\S*$/&#8230;/; # adds an ellipse (...)
    586588    $doc_obj->add_utf8_metadata ($thissection, "First$size", $tmptext);
    587589    }
Note: See TracChangeset for help on using the changeset viewer.