findHighlightChunksInText() function

findHighlightChunksInText() function

Adapt findMatchesInText for react-highlight-words findChunks handler. See https://github.com/bvaughn/react-highlight-words#props

Signature

  1. export declare function findHighlightChunksInText({ searchWords, textToHighlight, }: {
  2. searchWords: Array<string | RegExp>;
  3. textToHighlight: string;
  4. }): TextMatch[];

Import

  1. import { findHighlightChunksInText } from '@grafana/data';

Parameters

ParameterTypeDescription
{ searchWords, textToHighlight, }{
searchWords: Array<string | RegExp>;
textToHighlight: string;
}

Returns:

TextMatch[]