1.1.1 • Published 8 years ago
hi-lite v1.1.1
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