Changeset 14553


Ignore:
Timestamp:
2007-09-21T09:12:12+12:00 (17 years ago)
Author:
shaoqun
Message:

fixed wellformed tags;don't do converting character entities to their utf-8 as perl already takes care of it; make the image anchors work

File:
1 edited

Legend:

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

    r14233 r14553  
    172172    }
    173173
    174     if ($self->{'input_encoding'} eq "iso_8859_1") {
     174   if ($self->{'input_encoding'} eq "iso_8859_1") {
    175175    # convert to utf-8
    176176    $$text=&unicode::unicode2utf8(&unicode::convert2unicode("iso_8859_1", $text));
     
    178178    # convert any alphanumeric character entities to their utf-8
    179179    # equivalent for indexing purposes
    180     &ghtml::convertcharentities ($$text);
     180    #&ghtml::convertcharentities ($$text);
    181181
    182182    $$text =~ s/\s+/ /g; # remove \n's
     
    213213    # fix up the image links
    214214    $section =~ s/<img[^>]*?src=\"?([^\">]+)\"?[^>]*>/
    215     <center><img src=\"$1\"><\/center><br>/ig;
     215    <center><img src=\"$1\" \/><\/center><br/>/ig;
    216216    $section =~ s/&lt;&lt;I&gt;&gt;\s*([^\.]+\.(png|jpg|gif))/
    217     <center><img src=\"$1\"><\/center><br>/ig;
     217    <center><img src=\"$1\" \/><\/center><br\/>/ig;
    218218
    219219    return $section;
     
    390390        if ($self->{'old_style_HDL'})
    391391        {
    392         $hdl_output_filename = &util::filename_cat($tmp_dirname, "newHDL_$tailname$suffix");
     392        $hdl_output_filename = &util::filename_cat($tmp_dirname, "$tailname$suffix");
    393393        $hdl_output_filename = $self->convert_to_newHDLformat($input_filename,$hdl_output_filename);
    394394        }
     
    947947
    948948    my $anchor_name = $img_file;
    949     $anchor_name =~ s/^.*\///;
    950     $anchor_name = "<a name=\"$anchor_name\" />";
    951 
    952     return $front . $img_file . $back . $anchor_name;
     949    #$anchor_name =~ s/^.*\///;
     950    #$anchor_name = "<a name=\"$anchor_name\" ></a>";
     951
     952    my $image_link = $front . $img_file .$back;
     953    my $anchor_link = "<a href=\"$img_file\" >".$image_link."</a>"; 
     954
     955    return $anchor_link;   
     956    #return $front . $img_file . $back . $anchor_name;
    953957}
    954958
Note: See TracChangeset for help on using the changeset viewer.