Hi there,
I realize this is an older thread but I'll try to recessitate it. I've got this mod going on my site, but I would like to coordinate it with the search term highlighting plugin.
when I comment out the "strip html" code:
use HTML::Entities;
my $post_message = shift;
$post_message=~ s/^\s*//; # leading spaces
$post_message=~ s/\s*$//; # trailing spaces
$post_message=~ s/\s+/ /g; # multiple spaces
#
# Strip HTML tags
#
# $post_message=~ s(<[^>]*>)()g;
# $post_message=~ s(\[url.*\])()g;
# $post_message=~ s(\[\/url\])()g;
# $post_message=~ s(\[signature\])()g;
# $post_message=~ s(\[size*\])()g;
#
return substr($post_message,0,200);
}
I can see the search term highlighting html but the html is encoded so the code renders in the browser, not the html itself. Eg. > is >
I've tried some of the unencoding functions, but nothing works...
use HTML::Entities;
my $post_message = shift;
$post_message=~ s/^\s*//; # leading spaces
$post_message=~ s/\s*$//; # trailing spaces
$post_message=~ s/\s+/ /g; # multiple spaces
# Strip HTML tags
#
# $post_message=~ s(<[^>]*>)()g;
# $post_message=~ s(\[url.*\])()g;
# $post_message=~ s(\[\/url\])()g;
# $post_message=~ s(\[signature\])()g;
# $post_message=~ s(\[size*\])()g;
# convert < and > to < and >
#$post_message = GT::CGI::html_unescape($post_message); #
$post_message = decode_entities($post_message);
return substr($post_message,0,200);
}
The html remains encoded so it renders as code.
Can anybody help me here? I'm Going nuts!
Thanks,
Mike
I realize this is an older thread but I'll try to recessitate it. I've got this mod going on my site, but I would like to coordinate it with the search term highlighting plugin.
when I comment out the "strip html" code:
Code:
sub { use HTML::Entities;
my $post_message = shift;
$post_message=~ s/^\s*//; # leading spaces
$post_message=~ s/\s*$//; # trailing spaces
$post_message=~ s/\s+/ /g; # multiple spaces
#
# Strip HTML tags
#
# $post_message=~ s(<[^>]*>)()g;
# $post_message=~ s(\[url.*\])()g;
# $post_message=~ s(\[\/url\])()g;
# $post_message=~ s(\[signature\])()g;
# $post_message=~ s(\[size*\])()g;
#
return substr($post_message,0,200);
}
I can see the search term highlighting html but the html is encoded so the code renders in the browser, not the html itself. Eg. > is >
I've tried some of the unencoding functions, but nothing works...
Code:
sub { use HTML::Entities;
my $post_message = shift;
$post_message=~ s/^\s*//; # leading spaces
$post_message=~ s/\s*$//; # trailing spaces
$post_message=~ s/\s+/ /g; # multiple spaces
# Strip HTML tags
#
# $post_message=~ s(<[^>]*>)()g;
# $post_message=~ s(\[url.*\])()g;
# $post_message=~ s(\[\/url\])()g;
# $post_message=~ s(\[signature\])()g;
# $post_message=~ s(\[size*\])()g;
# convert < and > to < and >
#$post_message = GT::CGI::html_unescape($post_message); #
$post_message = decode_entities($post_message);
return substr($post_message,0,200);
}
The html remains encoded so it renders as code.
Can anybody help me here? I'm Going nuts!
Thanks,
Mike