Changeset 9056


Ignore:
Timestamp:
2005-02-16T11:59:50+13:00 (19 years ago)
Author:
kjdon
Message:

added an option to not strip html tags from metadata in description tags. contributed by jens wille

File:
1 edited

Legend:

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

    r9053 r9056  
    9191      { 'name' => "description_tags",
    9292    'desc' => "{HTMLPlug.description_tags}",
    93     'type' => "flag" } ];
     93    'type' => "flag" } ,
     94      { 'name' => "no_strip_metadata_html",
     95    'desc' => "{HTMLPlug.no_strip_metadata_html}",
     96    'type' => "string",
     97    'deft' => "",
     98    'reqd' => "no"}
     99      ];
    94100
    95101my $options = { 'name'     => "HTMLPlug",
     
    119125             q^title_sub/.*/^, \$self->{'title_sub'},
    120126             q^description_tags^, \$self->{'description_tags'},
     127             q^no_strip_metadata_html/.*/^, \$self->{'no_strip_metadata_html'},
    121128             "allow_extra_options")) {
    122129
     
    300307                    # were probably introduced when converting to HTML from
    301308                    # some other format).
     309            # actually some people want to have html tags in their
     310            # metadata.
    302311            $metavalue =~ s/[\cJ\cM]/ /sg;
    303             $metavalue =~ s/<[^>]+>//sg;
     312            my $dont = '';
     313            if ($self->{'no_strip_metadata_html'}) {
     314            ($dont = $self->{'no_strip_metadata_html'}) =~ s{,}{|}g;
     315            }
     316            $metavalue =~ s/<[^>]+>//sg
     317            unless $dont && ($dont eq 'all' || $metaname =~ /^($dont)$/);
     318            if ($dont && ($dont eq 'all' || $metaname =~ /^($dont)$/)) {
     319            }
    304320            $metavalue =~ s/\s+/ /sg;
    305321            if ($accumulate) {
Note: See TracChangeset for help on using the changeset viewer.