Bob Ross Highlight HTML
A package to highlight html. Based on Bob Ross powers.
“Wash the brush, just beats the devil out of it ” ― Bob Ross, The Joy of Painting with Bob Ross, Vol. 29
Install:
yarn add bob-ross-highlight-html
Run tests
yarn test
highlightTerm()
Returns the html with <mark>
tags on desired term
; // Method signature; // Pass a text to be scanned and a term to be highlighted// It returns: '<p>Highlight this, which is a <mark>small</mark> text</p>'; // If it fails to find exact word a fuzzy search fallback will be attempt and an approximate result will be marked// It fails then returns: '<p>Highlight this, which is a<mark> small t</mark>ext</p>'; // If you don't want to use fallback for fail attempts pass a false as third argument// It fails then returns: '<p>Highlight this, which is a small text</p>';