Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Mar 4, 2019. It is now read-only.

rpearce/highlightify

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Highlightify

Highlight portions of text given text, a filter and an optional className.

Installation

$ npm install highlightify --save

Usage

Node/Browserify/CommonJS

First, install it via NPM and save it to your project:

$ npm install highlightify --save

Import it where you need it:

import Highlightify from 'highlightify';

or if you are using < ES2015,

var Highlightify= require('highlightify');

and then call it with text, filter, and/or optional tagName or className options:

Highlightify({
  text: 'some text to match against', // required
  filter: 'ext', // required
  tagName: 'span', // optional. default: 'mark'
  className: 'is-highlighted' // optional. default: 'highlightify-is-match'
});
// => 'some t<span class="is-highlighted">ext</span> to match against'

Global Variable

Simply include the dist script on the page to gain access to it. There are development & production builds in the dist folder.

<!DOCTYPE html>
<html>
  <head></head>
  <body>
    <script src="path/to/highlightify.js"></script>
  </body>
</html>

Contribute

  1. Check out the issues
  2. Fork this repository
  3. Clone your fork
  4. Check out a feature branch ($ git checkout -b my-feature)
  5. Make your changes and push your branch to your GitHub repo
  6. Create a pull request from your branch to this repo's master
  7. When all is merged, pull down the upstream changes to your master

About

(unmaintained; use https://github.com/rpearce/flexible-string-replace instead) Highlight portions of text given text, a filter and an optional className.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.