Skip to content

Commit

Permalink
Merge pull request from GHSA-gfrh-gwqc-63cv
Browse files Browse the repository at this point in the history
  • Loading branch information
martinlagler committed Feb 5, 2024
1 parent 390b0e3 commit 570c781
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,17 @@ export default class Suggestion extends React.PureComponent<Props> {
matcher = this.props.query;
}

// $FlowFixMe: flow does not recognize the replaceAll method: https://github.com/facebook/flow/issues/560
const highlightedText = text.replaceAll(matcher, '<strong>$&</strong>');
const splittedText = text.split(matcher);
const highlightedWords = text.match(matcher);

return (
<span dangerouslySetInnerHTML={{__html: highlightedText}} />
);
return (<span>

Check failure on line 43 in src/Sulu/Bundle/AdminBundle/Resources/js/components/AutoCompletePopover/Suggestion.js

View workflow job for this annotation

GitHub Actions / Node Lint

Parentheses around JSX should be on separate lines
{splittedText.map((splitText, index) => {
return <>

Check failure on line 45 in src/Sulu/Bundle/AdminBundle/Resources/js/components/AutoCompletePopover/Suggestion.js

View workflow job for this annotation

GitHub Actions / Node Lint

Missing parentheses around multilines JSX
{splitText}
{highlightedWords && highlightedWords[index] ? <strong>{highlightedWords[index]}</strong> : null}
</>

Check failure on line 48 in src/Sulu/Bundle/AdminBundle/Resources/js/components/AutoCompletePopover/Suggestion.js

View workflow job for this annotation

GitHub Actions / Node Lint

Missing semicolon
})}
</span>);
};

handleClick = () => {
Expand Down

0 comments on commit 570c781

Please sign in to comment.