renderMatches
Official
Render the matches of a search.
Import:
import { renderMatches } from 'obsidian';Example:
renderMatches(document.body, 'foo', [[0, 3]]);Signature:
function renderMatches(el: DocumentFragment | HTMLElement, text: string, matches: SearchMatches | null, offset: number | undefined): voidParameters:
| Parameter | Type | Description |
|---|---|---|
el | DocumentFragment | HTMLElement | The element to render the matches to. |
text | string | The text to render the matches to. |
matches | SearchMatches | null | The matches to render. |
offset | number | undefined | The offset to render the matches to. |
Returns: void
Example:
renderMatches(document.body, 'foo', [[0, 3]]);