Fixed WebGUI::Asset::Wobject::Search::view() so HTML highlighting not broken by search phrase with unmatched char pairs
Fixed WebGUI::Asset::Wobject::Search::view() so HTML highlighting will not
be broken by a search phrase with unmatched char pairs like '()', '{}',
and '[]' (the HTML highlighter uses a regex internally for matching words
in the search phrase). Also fixed so ':' in the search phrase does not
confuse the HTML highlighter.
This commit is contained in:
parent
dc4f813a5f
commit
7a6ee77a06
2 changed files with 2 additions and 1 deletions
|
|
@ -199,7 +199,7 @@ sub view {
|
|||
$search->search(\%rules);
|
||||
|
||||
#Instantiate the highlighter
|
||||
my @words = grep { $_ ne '' } map { tr/+?*//d; $_; } split(/\s+/,$keywords);
|
||||
my @words = grep { $_ ne '' } map { tr/+?*:()[]{}//d; $_; } split(/\s+/,$keywords);
|
||||
my @wildcards = map { "%" } @words;
|
||||
my $hl = HTML::Highlight->new(
|
||||
words => \@words,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue