Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 1x 1x 2x 2x 2x 2x | import { updateHighlight } from './utils/updateHighlight';
import type { FindReplaceContext } from './types/FindReplaceContext';
import type { IEditor } from 'roosterjs-content-model-types';
/**
* Start a find operation in the editor
* @param editor The editor instance
* @param context The FindReplaceContext to use
* @param text The text to find
* @param matchCase Whether to match case
* @param wholeWord Whether to match whole words only
*/
export function find(
editor: IEditor,
context: FindReplaceContext,
text: string | null,
matchCase?: boolean,
wholeWord?: boolean
): void {
context.text = text;
context.matchCase = !!matchCase;
context.wholeWord = !!wholeWord;
updateHighlight(editor, context);
}
|