Changeset 9143 for trunk/gsdl/perllib/plugins
- Timestamp:
- 2005-02-23T10:08:05+13:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/HTMLPlug.pm
r9125 r9143 182 182 my @usemap_matches = ($$textref =~ m/<img[^>]*?usemap\s*=\s*($attval)[^>]*>/igs); 183 183 my @link_matches = ($$textref =~ m/<link[^>]*?href\s*=\s*($attval)[^>]*>/igs); 184 185 186 foreach my $link (@img_matches, @usemap_matches, @link_matches ) {184 my @embed_matches = ($$textref =~ m/<embed[^>]*?src\s*=\s*($attval)[^>]*>/igs); 185 186 foreach my $link (@img_matches, @usemap_matches, @link_matches, @embed_matches) { 187 187 188 188 # remove quotes from link at start and end if necessary … … 194 194 $link =~ s/\#.*$//s; # remove any anchor names, e.g. foo.html#name becomes foo.html 195 195 196 if ($link !~ s@^/@@ && $link !~/^([A-Z]:?)\\/) {196 if ($link !~ m@^/@ && $link !~ m/^([A-Z]:?)\\/) { 197 197 # Turn relative file path into full path 198 198 my $dirname = &File::Basename::dirname($filename); … … 200 200 } 201 201 $link = $self->eval_dir_dots($link); 202 202 203 $self->{'file_blocks'}->{$link} = 1; 203 204 } … … 238 239 my $web_url = "http://$file"; 239 240 $doc_obj->add_metadata($cursection, "URL", $web_url); 241 $doc_obj->add_metadata($cursection, "weblink", "<a href=\"$web_url\">"); 242 $doc_obj->add_metadata($cursection, "webicon", "_iconworld_"); 243 $doc_obj->add_metadata($cursection, "/weblink", "</a>"); 240 244 241 245 if ($self->{'description_tags'}) { … … 397 401 398 402 # allow spaces if inside quotes - jrm21 399 $$textref =~ s/(< img[^>]*?src\s*=\s*)(\"[^\"]+\"|[^\s>]+)([^>]*>)/403 $$textref =~ s/(<(?:img|embed)[^>]*?src\s*=\s*)(\"[^\"]+\"|[^\s>]+)([^>]*>)/ 400 404 $self->replace_images ($1, $2, $3, $base_dir, $file, $doc_obj, $cursection)/isge; 401 405 … … 430 434 431 435 my ($href, $hash_part, $rl) = $self->format_link ($link, $base_dir, $file); 432 436 433 437 my $img_file = $self->add_file ($href, $rl, $hash_part, $base_dir, $doc_obj, $section); 438 434 439 my $anchor_name = $img_file; 435 440 $anchor_name =~ s/^.*\///; … … 503 508 504 509 my ($ext) = $filename =~ /(\.[^\.]*)$/; 510 511 if ($rl == 0) { 512 if ((!defined $ext) || ($ext !~ /$self->{'assoc_files'}/)) { 513 return "_httpextlink_&rl=0&el=prompt&href=" . $href . $hash_part; 514 } 515 else { 516 return "_httpextlink_&rl=0&el=direct&href=" . $href . $hash_part; 517 } 518 } 505 519 506 520 if ((!defined $ext) || ($ext !~ /$self->{'assoc_files'}/)) { … … 592 606 } 593 607 else { 608 # before_hash has lost leading slash by this point, 609 # -> add back in prior to substitution with $base_dir 610 $before_hash = "/$before_hash"; 611 594 612 $before_hash = &util::filename_cat("",$before_hash); 595 613 $before_hash =~ s@^$base_dir/@@;
Note:
See TracChangeset
for help on using the changeset viewer.