@textlint-rule/tokenize-htmltext

2.0.2 • Public • Published

@textlint-rule/tokenize-htmltext

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

Installation

$ npm install @textlint-rule/tokenize-htmltext

Usage

var tokenizeHTML = require('@textlint-rule/tokenize-htmltext');


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

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

Readme

Keywords

none

Package Sidebar

Install

npm i @textlint-rule/tokenize-htmltext

Weekly Downloads

122

Version

2.0.2

License

Apache-2.0

Unpacked Size

14.4 kB

Total Files

6

Last publish

Collaborators

  • azu
  • nodaguti
  • 0x6b
  • hata6502
  • textlint-user