Skip to content

Commit

Permalink
fix(front): correct highlight of apostrophe
Browse files Browse the repository at this point in the history
  • Loading branch information
ahonestla committed Jul 23, 2024
1 parent 12ce806 commit 3a85c37
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion project/front/src/components/input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function Input() {
buttonLabel="Match"
defaultValue={currentQuery}
placeholder="Affiliation string"
onSearch={(value) => handleQueryChange(value)}
onSearch={(value) => handleQueryChange(value.toLowerCase())}
/>
</Col>
<Col xs="12" sm="4" lg="4">
Expand Down
1 change: 1 addition & 0 deletions project/front/src/components/results/utils/highlights.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ export const getHighlightedText = (highlight: string): TextHighlight => {
export function getHighlightedQuery(highlightedArray: TextHighlight, query: string) {
let highlightedQuery = query
highlightedArray.forEach((text) => (highlightedQuery = highlightedQuery.replace(text, `<b>${text}</b>`)))
highlightedQuery = highlightedQuery.replace(/'/g, "''")
return highlightedQuery
}

0 comments on commit 3a85c37

Please sign in to comment.