0.1.0-5 • Published 6 years ago

tokenz-html v0.1.0-5

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

tokenz-html

Tokenizes HTML using tokenz package.

  • Lightweight (flat dependency tree)
  • Adheres to HTML standard
  • Closes unclosed tokens if end of text is reached
  • Doesn't include CDATA (create an issue if you want this)

Install

Install package html-tokenz with npm/yarn/pnpm.

Usage

import { tokenize, tokenTypes } from 'tokenz-html'

tokenize(`<a qwe=asd><b><!-- hey there --></a`)
/* [
  { name: 'a', attrs: [{ name: 'qwe', value: 'asd' }, type: 'start_tag' ] },
  { name: 'b', type: 'start_tag' },
  { text: ' hey there ', type: 'comment' },
  { name: 'a', type: 'close_tag' },
]
*/
0.1.0-11

6 years ago

0.1.0-12

6 years ago

0.1.0-13

6 years ago

0.1.0-9

6 years ago

0.1.0-10

6 years ago

0.1.0-8

6 years ago

0.1.0-7

6 years ago

0.1.0-6

6 years ago

0.1.0-5

6 years ago

0.1.0-4

6 years ago

0.1.0-3

6 years ago

0.1.0-2

6 years ago

0.1.0-1

6 years ago

0.1.0-0

6 years ago