Detalhes do pacote

markup_highlight

Add markup highlight to the results in web based search interface

search highlight, markup highlight

readme (leia-me)

Markup Highlight

install size

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

  1. Install the dependency.

    npm i markup_highlight

  2. Import the MarkupHighLight class in your module or component, as shown in code snippet below,

    import { MarkupHighLight } from 'markup-highlight';
  3. Invoke the constructor MarkupHighLight(searchText, searchKey) to set the intial properties.

    const markupObject = new MarkupHighLight(searchText, searchKey);
  4. After setting the values in constructor, invoke getHighLightedText() method to get the highlighted.

    const result = markupObject.getHighLightedText();

Examples

  1. For usage in Typescript, please refer here.

  2. For Usage in Angular application, please refer here.