parse5
HTML parser and serializer.
npm install --save parse5
📖 Documentation 📖
Usage
Parse HTML into a document tree and serialize it back to HTML.
import { parse, serialize } from 'parse5';
const document = parse('<p>Hello, world!</p>');
console.log(serialize(document));
// <html><head></head><body><p>Hello, world!</p></body></html>
List of parse5 toolset packages
GitHub
Online playground
Changelog
Namespaces
- DefaultTreeAdapterTypes
- html
- Token
Enumerations
- ErrorCodes
- InsertionMode
Classes
- Parser
Interfaces
- ElementCreationContext
- ParserError
- ParserOptions
- SerializerOptions
- TreeAdapter
- TreeAdapterTypeMap
Type Aliases
- DefaultTreeAdapterMap
- ParserErrorHandler
Variables
- defaultTreeAdapter
Functions
- parse
- parseFragment
- serialize
- serializeOuter