78 |
# |
# |
79 |
my $html; |
my $html; |
80 |
|
|
81 |
|
if ($param->{'search_val'} && $param->{'search_fld'} && !$param->{'search'}) { |
82 |
|
$param->{'search'} = $param->{'search_fld'}.":".$param->{'search_val'}; |
83 |
|
} |
84 |
|
|
85 |
# show search results |
# show search results |
86 |
# ?search=foo:bar |
# ?search=foo:bar |
87 |
if ($param->{'search'}) { |
if ($param->{'search'}) { |
123 |
|
|
124 |
# template toolkit filter |
# template toolkit filter |
125 |
|
|
126 |
|
#use Text::Context::EitherSide; |
127 |
|
|
128 |
sub body5_filter { |
sub body5_filter { |
129 |
my $text = shift; |
my $text = shift; |
130 |
$text =~ s/^\s+//gs; |
$text =~ s/^\s+//gs; |
131 |
$text =~ s/[\n\r]+[\>:\|=]+\s*.*?[\n\r]+//sg; # remove quoted text |
$text =~ s/^[\>:\|=]+\s*.*?$//msg; # remove quoted text |
132 |
|
$text =~ s/[\n\r]+/\n/gs; # compress cr/lf |
133 |
$text =~ s,^((?:.*?[\n\r]){5}).*$,$1<span style="color:#808080">--8<--[cut]--8<--</span>,s; |
$text =~ s,^((?:.*?[\n\r]){5}).*$,$1<span style="color:#808080">--8<--[cut]--8<--</span>,s; |
134 |
$text =~ s/[\n\r]+--\s*[\n\r]+.*$//s; |
$text =~ s/[\n\r]+--\s*[\n\r]+.*$//s; |
135 |
|
|
136 |
|
# my $context = Text::Context::EitherSide->new($text, context => 5); |
137 |
|
# return $context->as_string("perl"); |
138 |
|
|
139 |
return $text; |
return $text; |
140 |
} |
} |
141 |
|
|