Skip to content

nsargeant/hi-lite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hi-lite

Server-side html highlighting

Getting Started

npm i hi-lite

Example

const highlight = require('hi-lite'),
  query = 'test',
  html = `<p>this is a test</p>`;

highlight(query, html);
//RETURNS
// <p>this is a <mark>test</mark></p>

API

highlight(query, html, [options])

  • query: {String} - text to highlight in html content
  • html: {String} - HTML content.
  • [options]: {Object} - Parser and serializer options
  • parser: {Object} - see htmlparser2 options
  • serializer: {Object} - see dom-serializer

About

Server-side html highlighting

Resources

License

Stars

Watchers

Forks

Packages

No packages published