Changeset 14996 for gsdl


Ignore:
Timestamp:
2008-02-18T11:22:20+13:00 (16 years ago)
Author:
shaoqun
Message:

add an option to disable the image links trap

File:
1 edited

Legend:

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

    r14913 r14996  
    113113      { 'name' => "is_old_HDL_tags",
    114114        'desc' => "{HTMLPlug.old_style_HDL}",
    115     'type' => "flag"}   
     115    'type' => "flag"},
     116      { 'name' => "no_image_links",
     117        'desc' => "{HTMLPlug.no_image_links}",
     118    'type' => "flag"}, 
    116119      ];
    117120
     
    878881    # trap links
    879882    if (!$self->{'nolinks'}) {
    880 
    881883    # usemap="./#index" not handled correctly => change to "#index"
    882884    $$textref =~ s/(<img[^>]*?usemap\s*=\s*[\"\']?)([^\"\'>\s]+)([\"\']?[^>]*>)/
     
    888890
    889891    # trap images
    890 
    891     # allow spaces if inside quotes - jrm21
    892     $$textref =~ s/(<(?:img|embed|table|tr|td)[^>]*?(?:src|background)\s*=\s*)([\"\'][^\"\']+[\"\']|[^\s>]+)([^>]*>)/
    893     $self->replace_images ($1, $2, $3, $base_dir, $file, $doc_obj, $cursection)/isge;
     892   if(!$self->{'no_image_links'}){
     893    $$textref =~ s/(<(?:img|embed|table|tr|td)[^>]*?(?:src|background)\s*=\s*)([\"\'][^\"\']+[\"\']|[^\s>]+)([^>]*>)/
     894        $self->replace_images ($1, $2, $3, $base_dir, $file, $doc_obj, $cursection)/isge;
     895    }
    894896
    895897    # add text to document object
Note: See TracChangeset for help on using the changeset viewer.