package
A HTML parser extracted from Angular with some modifications
npm install angular-html-parserGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
An HTML parser extracted from Angular with some modifications
[!TIP] Try sync
mainanddevbranch with upstream first
# using npm
npm install --save angular-html-parser
# using yarn
yarn add angular-html-parserimport { parse } from "angular-html-parser";
const { rootNodes, errors } = parse(`
<!DOCTYPE html>
<html>
<head>
<title>Hello world!</title>
</head>
<body>
<div>Hello world!</div>
</body>
</html>
`);declare function parse(input: string, options?: Options): ng.ParseTreeResult;
interface Options {
/**
* any element can self close
*
* defaults to false
*/
canSelfClose?: boolean;
/**
* support [`htm`](https://github.com/developit/htm) component closing tags (`<//>`)
*
* defaults to false
*/
allowHtmComponentClosingTags?: boolean;
/**
* do not lowercase tag names before querying their tag definitions
*
* defaults to false
*/
isTagNameCaseSensitive?: boolean
CDATA nodeDocType nodenameSpan field to Element and AttributeComment#sourceSpan<!...>, <?...>)type property to nodes# build
yarn run build
# test
yarn run testMIT © Ika
fisker
lionkay@gmail.com
Estimated unpacked size across 1 packages.
199.1 kB
Includes dependencies.