Skip to content

A small library for splitting an HTML string into its top-level sections. Based on html5parser.

License

Notifications You must be signed in to change notification settings

fabiospampinato/html-segmentator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTML Segmentator

A small library for splitting an HTML string into its top-level sections. Based on html5parser.

Install

npm install --save html-segmentator

Usage

import segmentator from 'html-segmentator';

// Splitting an HTML string into its top-level sections

const html = '<div><b>foo</b></div><i>bar</i>';
const segments = segmentator ( html );

console.log ( segments );
// [
//   { start: 0, end: 21 },
//   { start: 21, end: 31 }
// ]

License

  • Library MIT © Fabio Spampinato.
  • Tokenizer MIT © html5parser.

About

A small library for splitting an HTML string into its top-level sections. Based on html5parser.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published