Changeset 23392
- Timestamp:
- 2010-12-07T11:32:49+13:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/HTMLPlugin.pm
r23387 r23392 702 702 ## $$textref =~ s/(<img[^>]*?usemap\s*=\s*[\"\']?)([^\"\'>\s]+)([\"\']?[^>]*>)/ 703 703 704 my $opencom = '(?:<!--|<!(?:—|—|--))';705 my $closecom = '(?:-->|(?:—|—|--)>)';704 ## my $opencom = '(?:<!--|<!(?:—|—|--))'; 705 ## my $closecom = '(?:-->|(?:—|—|--)>)'; 706 706 707 707 $$textref =~ s/(<img[^>]*?usemap\s*=\s*)((?:[\"][^\"]+[\"])|(?:[\'][^\']+[\'])|(?:[^\s\/>]+))([^>]*>)/ 708 708 $self->replace_usemap_links($1, $2, $3)/isge; 709 709 710 ## $$textref =~ s/(<(?:a|area|frame|link|script)\s+[^>]*?\s*(?:href|src)\s*=\s*[\"\']?)([^\"\'>\s]+)([\"\']?[^>]*>)/ 710 $$textref =~ s/(<(?:a|area|frame|link|script)\s+[^>]*?\s*(?:href|src)\s*=\s*[\"\']?)([^\"\'>\s]+)([\"\']?[^>]*>)/ 711 $self->replace_href_links ($1, $2, $3, $base_dir, $file, $doc_obj, $cursection)/isge; 711 712 712 $$textref =~ s/($opencom.*?)?+(<(?:a|area|frame|link|script)\s+[^>]*?\s*(?:href|src)\s*=\s*)((?:[\"][^\"]+[\"])|(?:[\'][^\']+[\'])|(?:[^\s\/>]+))([^>]*>)(.*?$closecom)?+/713 $self->replace_href_links ($1, $2, $3, $4, $5, $base_dir, $file, $doc_obj, $cursection)/isge;713 ## $$textref =~ s/($opencom.*?)?+(<(?:a|area|frame|link|script)\s+[^>]*?\s*(?:href|src)\s*=\s*)((?:[\"][^\"]+[\"])|(?:[\'][^\']+[\'])|(?:[^\s\/>]+))([^>]*>)(.*?$closecom)?+/ 714 # $self->replace_href_links ($1, $2, $3, $4, $5, $base_dir, $file, $doc_obj, $cursection)/isge; 714 715 } 715 716 … … 794 795 sub replace_href_links { 795 796 my $self = shift (@_); 796 my ($opt_open_comm, $front, $link, $back, $opt_close_comm, $base_dir, $file, $doc_obj, $section) = @_; 797 798 if ((defined $opt_open_comm) && (defined $opt_close_comm)) { 799 # href link was embedded in <!-- comments --> 800 ### print STDERR "****** Link in comment, skipping $link\n"; 801 return $opt_open_comm . $front . $link . $back . $opt_close_comm; 802 } 797 my ($front, $link, $back, $base_dir, $file, $doc_obj, $section) = @_; 803 798 804 799 # remove quotes from link at start and end if necessary
Note:
See TracChangeset
for help on using the changeset viewer.