Skip to content

GitbookIO/tokenize-htmltext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tokenize-htmltext

Build Status NPM version

Tokenize an html string into a list of text tokens, it keeps reference to indexes in the original string.

Installation

$ npm install tokenize-htmltext

Usage

var tokenizeHTML = require('tokenize-htmltext');


var tokens = tokenizeHTML('<b>hello</b> world');

/*
[ { value: 'hello', index: 3, offset: 5 },
  { value: ' world', index: 12, offset: 6 } ]
*/

About

Tokenize HTML in an array of text tokens

Resources

License

Stars

Watchers

Forks

Packages

No packages published