Changeset 732 for trunk/gsdl
- Timestamp:
- 1999-10-20T17:23:48+13:00 (25 years ago)
- Location:
- trunk/gsdl/perllib/plugins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/HTMLPlug.pm
r721 r732 263 263 $text =~ s/\s+/ /g; 264 264 265 # see if there's a <title> tag266 265 my $foundtitle = 0; 267 if ($text =~ /<title[^>]*>([^<]*)<\/title[^>]*>/i) { 268 if (defined $1) { 269 my $title = $1; 270 if ($title =~ /\w/) { 271 $doc_obj->add_metadata ($cursection, "Title", $title); 272 $foundtitle = 1; 266 # don't use title tag if Title has been passed 267 # in from another plugin 268 if (defined $metadata->{'Title'}) { 269 $foundtitle = 1; 270 } 271 if (!$foundtitle) { 272 # see if there's a <title> tag 273 if ($text =~ /<title[^>]*>([^<]*)<\/title[^>]*>/i) { 274 if (defined $1) { 275 my $title = $1; 276 if ($title =~ /\w/) { 277 $doc_obj->add_metadata ($cursection, "Title", $title); 278 $foundtitle = 1; 279 } 273 280 } 274 281 } -
trunk/gsdl/perllib/plugins/TEXTPlug.pm
r639 r732 82 82 my $text = ""; 83 83 my $line = ""; 84 my $first = 1; 84 my $foundtitle = 0; 85 # don't need to get title if it has been passed 86 # in from another plugin 87 if (defined $metadata->{'Title'}) { 88 $foundtitle = 1; 89 } 85 90 while (defined ($line = <FILE>)) { 86 91 # use first line as title (or first 100 characters if it's long) 87 if ( $first&& length($line) > 5) {92 if (!$foundtitle && length($line) > 5) { 88 93 my $title = ""; 89 94 if (length($line) > 100) { … … 93 98 } 94 99 $doc_obj->add_metadata ($cursection, "Title", $title); 95 $f irst = 0;100 $foundtitle = 1; 96 101 } 97 102 $text .= $line;
Note:
See TracChangeset
for help on using the changeset viewer.