posthtml-parser
- Version 0.12.1
- Published
- 12.3 kB
- 1 dependency
- MIT license
Install
npm i posthtml-parser
yarn add posthtml-parser
pnpm add posthtml-parser
Overview
Parse HTML/XML to PostHTMLTree
Index
Functions
function parser
parser: (html: string, options?: Options) => Node[];
Type Aliases
type Attributes
type Attributes = Record<string, string | number | boolean>;
type Content
type Content = NodeText | Array<Node | Node[]>;
type Directive
type Directive = { name: string | RegExp; start: string; end: string;};
type Node
type Node = NodeText | NodeTag;
type NodeTag
type NodeTag = { tag?: Tag; attrs?: Attributes; content?: Content; location?: SourceLocation;};
type NodeText
type NodeText = string | number;
type Options
type Options = { directives?: Directive[]; sourceLocations?: boolean; recognizeNoValueAttribute?: boolean;} & ParserOptions;
type Tag
type Tag = string | boolean;
Package Files (1)
Dependencies (1)
Dev Dependencies (12)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/posthtml-parser
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/posthtml-parser)
- HTML<a href="https://www.jsdocs.io/package/posthtml-parser"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 2381 ms. - Missing or incorrect documentation? Open an issue for this package.