Changeset 23392


Ignore:
Timestamp:
2010-12-07T11:32:49+13:00 (13 years ago)
Author:
sjm84
Message:

Reverted a regular expression designed to locate various tags inside comments (David)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/HTMLPlugin.pm

    r23387 r23392  
    702702##  $$textref =~ s/(<img[^>]*?usemap\s*=\s*[\"\']?)([^\"\'>\s]+)([\"\']?[^>]*>)/
    703703
    704     my $opencom = '(?:<!--|&lt;!(?:&mdash;|&#151;|--))';
    705     my $closecom = '(?:-->|(?:&mdash;|&#151;|--)&gt;)';
     704##  my $opencom = '(?:<!--|&lt;!(?:&mdash;|&#151;|--))';
     705##  my $closecom = '(?:-->|(?:&mdash;|&#151;|--)&gt;)';
    706706
    707707    $$textref =~ s/(<img[^>]*?usemap\s*=\s*)((?:[\"][^\"]+[\"])|(?:[\'][^\']+[\'])|(?:[^\s\/>]+))([^>]*>)/
    708708        $self->replace_usemap_links($1, $2, $3)/isge;
    709709
    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;
    711712   
    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;
    714715    }
    715716
     
    794795sub replace_href_links {
    795796    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) = @_;
    803798
    804799    # remove quotes from link at start and end if necessary
Note: See TracChangeset for help on using the changeset viewer.