Changeset 11286


Ignore:
Timestamp:
2006-02-17T16:49:46+13:00 (18 years ago)
Author:
kjdon
Message:

Richards (DLC) fixes for allowing single quotes to surround href, src etc attributes

File:
1 edited

Legend:

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

    r10725 r11286  
    466466
    467467    # usemap="./#index" not handled correctly => change to "#index"
    468     $$textref =~ s/(<img[^>]*?usemap\s*=\s*\"?)([^\">\s]+)(\"?[^>]*>)/
     468    $$textref =~ s/(<img[^>]*?usemap\s*=\s*[\"\']?)([^\"\'>\s]+)([\"\']?[^>]*>)/
    469469        $self->replace_usemap_links($1, $2, $3)/isge;
    470470
    471     $$textref =~ s/(<(?:a|area|frame|link|script)\s+[^>]*?\s*(?:href|src)\s*=\s*\"?)([^\">\s]+)(\"?[^>]*>)/
     471    $$textref =~ s/(<(?:a|area|frame|link|script)\s+[^>]*?\s*(?:href|src)\s*=\s*[\"\']?)([^\"\'>\s]+)([\"\']?[^>]*>)/
    472472        $self->replace_href_links ($1, $2, $3, $base_dir, $file, $doc_obj, $cursection)/isge;
    473473    }
     
    476476
    477477    # allow spaces if inside quotes - jrm21
    478     $$textref =~ s/(<(?:img|embed|table|tr|td)[^>]*?(?:src|background)\s*=\s*)(\"[^\"]+\"|[^\s>]+)([^>]*>)/
     478    $$textref =~ s/(<(?:img|embed|table|tr|td)[^>]*?(?:src|background)\s*=\s*)([\"\'][^\"\']+[\"\']|[^\s>]+)([^>]*>)/
    479479    $self->replace_images ($1, $2, $3, $base_dir, $file, $doc_obj, $cursection)/isge;
    480480
     
    493493
    494494    # remove quotes from link at start and end if necessary
    495     if ($link=~/^\"/) {
    496     $link=~s/^\"//;$link=~s/\"$//;
     495    if ($link=~/^[\"\']/) {
     496    $link=~s/^[\"\']//;$link=~s/[\"\']$//;
    497497    $front.='"';
    498498    $back="\"$back";
Note: See TracChangeset for help on using the changeset viewer.