0.1.0-5 • Published 4 years ago

tokenz-html v0.1.0-5

Weekly downloads
1
License
MIT
Repository
-
Last release
4 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

4 years ago

0.1.0-12

4 years ago

0.1.0-13

4 years ago

0.1.0-9

4 years ago

0.1.0-10

4 years ago

0.1.0-8

4 years ago

0.1.0-7

4 years ago

0.1.0-6

4 years ago

0.1.0-5

4 years ago

0.1.0-4

4 years ago

0.1.0-3

4 years ago

0.1.0-2

4 years ago

0.1.0-1

4 years ago

0.1.0-0

4 years ago