Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Bizarre problem -- GT PLEASE HELP!!!

Quote Reply
Bizarre problem -- GT PLEASE HELP!!!
I'm using the search highlighting plugin and I'm having a problem that is DRIVING ME CRAZY Crazy

If you put the following tag in the search results loop:

Code:
<%if post_message%>

<%post_message%>

<%endif%>

as expected it will print out the entire post with the search terms highlighted for each record in the search results...

But if I try to shorten the post to 200 characters by running it throught the following global


Code:
sub {

my $p = shift;
return = substr($p,0,200);
}

as follows:

Code:
<%if post_message%>

<%html_strip($post_message)%>

<%endif%>
The post gets html escaped and all the html entities are returned as encoded: ie &lt; for <, &gt; for >, etc

NOTHING I do to unescape the string seems to effect it! For example:

Code:
sub {

my $p = shift;
$p = substr($p,0,200);
return GT::CGI::html_unescape($p);
}

I've tried regex:

Code:
sub {

my $p = shift;
$p = substr($p,0,200);

# convert &lt; and &gt; to < and >
$p =~ s/&gt;/>/g;
$p =~ s/&lt;/</g;
return $p;
}
Even just passing through the variable html escapes the string:

Code:
sub {

my $p = shift;
return $p;
}

So there must be something going on in the global parsing behind the scenes...

ps. I've also tried HTML::Entities.

GT? Anybody? Help? There must be a solution...
Subject Author Views Date
Thread Bizarre problem -- GT PLEASE HELP!!! Swaylock 2558 Feb 16, 2006, 12:10 AM
Thread Re: [Swaylock] Bizarre problem -- GT PLEASE HELP!!!
eupos 2477 Feb 16, 2006, 12:18 AM
Thread Re: [eupos] Bizarre problem -- GT PLEASE HELP!!!
Swaylock 2474 Feb 16, 2006, 7:39 AM
Post Re: [Swaylock] Bizarre problem -- GT PLEASE HELP!!!
eupos 2469 Feb 16, 2006, 8:18 AM