1.3.7 • Published 4 years ago
markup_highlight v1.3.7
Markup Highlight
Introduction
Markup Highlight is a library, which will process a string or a set of strings against a search key and modify the input string by highlighting the matched part from the input strings.
Steps to use
Install the dependency.
npm i markup_highlight
Import the
MarkupHighLight
class in your module or component, as shown in code snippet below,import { MarkupHighLight } from 'markup-highlight';
Invoke the constructor
MarkupHighLight(searchText, searchKey)
to set the intial properties.const markupObject = new MarkupHighLight(searchText, searchKey);
After setting the values in constructor, invoke
getHighLightedText()
method to get the highlighted.const result = markupObject.getHighLightedText();