Skip to content

Commit

Permalink
fix(frontend): query is not a regexp (#2393)
Browse files Browse the repository at this point in the history
  • Loading branch information
UnbearableBear authored Feb 20, 2020
1 parent 5784438 commit 845e59c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ const SuggestionContainer = styled.div`
`;

const renderSuggestion = (suggestion, query) => {
const regexp = new RegExp(query);
const title = suggestion.replace(regexp, "<b>$&</b>");
const title = suggestion.replace(query, `<b>${query}</b>`);
return (
<SuggestionContainer>
<Html inline>{title}</Html>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const SearchBar = ({
router.push({
pathname: "/recherche",
query: {
q: query
q: query.trim()
}
});
}
Expand Down

0 comments on commit 845e59c

Please sign in to comment.