On Fri, Aug 19, 2005 at 01:03:14PM -0700, Loren Gordon wrote:
> Oh, I see that setting now. Yes, I'm using TemplateDefault. And yes, if I select Title & Body, Title, or Document Path, then it looks just fine. But if I select All, then the tags show up around the highlighted term.
>
> What does a "warn" statement look like?
Oh. ok. Well, might be harder if you don't know Perl.
You do things like:
warn "I'm here! and prop [$prop]";
Here's that bit of code. I'll try and look later, but today is not
looking that great.
# Returns hash of the properties that were highlighted
my $highlighted = $self->highlight_props( $props ) || {};
(ok, the above is suppose to tell if a given property was highlighted)
my $trim_prop = $self->config('description_prop') || '';
$props->{$trim_prop} ||= ''
if $trim_prop;
# HTML escape all properties that were not highlighted
for my $prop (keys %$props) {
next if $highlighted->{$prop};
(and then above, if the property now included highlighted text then
next is called to skip the code below (which escaped the html)).
# not highlighted, so escape
html_escape( $props->{$prop} );
if ( $prop eq $trim_prop ) {
my $max = $self->config('max_chars') || 500;
$props->{$trim_prop} = substr( $props->{$trim_prop}, 0, $max) . ' <b>...</b>'
if length $props->{$trim_prop} > $max;
}
}
>
> Loren
>
>
> ----- Start Original Message -----
> From: Bill Moseley <moseley@hank.org>
> To: Multiple recipients of list <swish-e@sunsite3.berkeley.edu>
> Subject: [SWISH-E] Re: <font> tag appears in SwishTitle?
>
> > On Fri, Aug 19, 2005 at 10:30:56AM -0700, Loren Gordon wrote:
> > > By output module, do you mean SWISH::DefaultHightlight,
> > > SWISH::PhraseHighlight, and SWISH::SimpleHighlight? It's set up for
> > > PhraseHighlight, which was the default. I just tried the other two,
> > > but all three are displaying the <font> tags in the title when I
> > > search under "All."
> >
> > No, which Template module are you using. If you haven't changed from
> > the default it's TemplateDefault.
> >
> > I don't really see where that would get escaped. If you just search
> > in the title then the highlighting works, but if you search ALL then
> > the html is escaped (which displays it as text). Right?
> >
> > In swish.cgi there's a bit of discussion about the problems with
> > highlighting and escaping the html above the "add_result_to_list"
> > function/method.
> >
> > It's not suppose to escape if a property is highlighted. A few "warn"
> > statements in that section would likely show what's wrong.
> >
> >
> >
> > --
> > Bill Moseley
> > moseley@hank.org
> >
> > Unsubscribe from or help with the swish-e list:
> > http://swish-e.org/Discussion/
> >
> > Help with Swish-e:
> > http://swish-e.org/current/docs
> > swish-e@sunsite.berkeley.edu
> >
> >
>
> ----- End Original Message -----
>
>
--
Bill Moseley
moseley@hank.org
Unsubscribe from or help with the swish-e list:
http://swish-e.org/Discussion/
Help with Swish-e:
http://swish-e.org/current/docs
swish-e@sunsite.berkeley.edu
Received on Fri Aug 19 13:15:15 2005