mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-08 14:51:32 +00:00
committed by
Eugenio Romano
parent
53d96679ea
commit
e39a2b149b
@@ -11,12 +11,12 @@ Adds HTML to a string to highlight chosen sections.
|
||||
|
||||
### Methods
|
||||
|
||||
- **highlight**(text: `string`, search: `string`, wrapperClass: `string` = `"highlight"`): `HightlightTransformResult`<br/>
|
||||
- **highlight**(text: `string`, search: `string`, wrapperClass: `string` = `"highlight"`): `HighlightTransformResult`<br/>
|
||||
Searches for `search` string(s) within `text` and highlights all occurrences.
|
||||
- _text:_ `string` - Text to search within
|
||||
- _search:_ `string` - Text pattern to search for
|
||||
- _wrapperClass:_ `string` - CSS class used to provide highlighting style
|
||||
- **Returns** `HightlightTransformResult` - New text along with boolean value to indicate whether anything was highlighted
|
||||
- **Returns** `HighlightTransformResult` - New text along with boolean value to indicate whether anything was highlighted
|
||||
|
||||
## Details
|
||||
|
||||
@@ -31,11 +31,11 @@ highlight any of those words individually. The <span> element includes a
|
||||
`class` attribute which defaults to "highlight" but you can pass any class name
|
||||
you like using the `wrapperClass` parameter.
|
||||
|
||||
The resulting text with HTML highlighting is returned within a [`HightlightTransformResult`](../../lib/core/services/highlight-transform.service.ts)
|
||||
The resulting text with HTML highlighting is returned within a [`HighlightTransformResult`](../../lib/core/services/highlight-transform.service.ts)
|
||||
object:
|
||||
|
||||
```ts
|
||||
interface HightlightTransformResult {
|
||||
interface HighlightTransformResult {
|
||||
text: string;
|
||||
changed: boolean;
|
||||
}
|
||||
|
Reference in New Issue
Block a user