Miscellaneous
highlight()
Signature
Section titled “Signature”highlight() — returns any
Description
Section titled “Description”Highlights the phrase(s) everywhere in the text if found by wrapping it in a span tag.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
text | string | yes | — | Text to search. |
phrases | string | yes | — | List of phrases to highlight. |
delimiter | string | yes | , | Delimiter to use in phrases argument. |
tag | string | yes | span | HTML tag to use to wrap the highlighted phrase(s). |
class | string | yes | highlight | Class to use in the tags wrapping highlighted phrase(s). |
Examples
Section titled “Examples”#highlight(text="You searched for: Wheels", phrases="Wheels")# -> You searched for: <span class="highlight">Wheels</span>