# new ExactPhraseHighlighter(highlightFunction)
Parameters:
| Name | Type | Description |
|---|---|---|
highlightFunction |
function
|
Returns highlight markup; the boolean indicates whether the segment starts a new occurrence. |
Methods
# highlightOccurrences(nodes, occurrences, searchLength)
Replaces matched text nodes with wrappers containing highlighted segments. Other text and surrounding markup are preserved. The wrappers also allow the tab-search reset logic to remove the highlights.
Parameters:
| Name | Type | Description |
|---|---|---|
nodes |
Array.<Text>
|
Searchable text nodes in document order. |
occurrences |
Array.<number>
|
Ascending, non-overlapping match offsets in the concatenated node text, measured in UTF-16 code units. |
searchLength |
number
|
Match length in UTF-16 code units. |