From 83354b2b88218090988dd6e526b0a2505b57e0f1 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Thu, 6 Apr 2023 22:18:28 +0200 Subject: Updated 5 files and added 1110 files (automated) --- .../addressbook/node_modules/domhandler/readme.md | 92 ++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 includes/external/addressbook/node_modules/domhandler/readme.md (limited to 'includes/external/addressbook/node_modules/domhandler/readme.md') diff --git a/includes/external/addressbook/node_modules/domhandler/readme.md b/includes/external/addressbook/node_modules/domhandler/readme.md new file mode 100644 index 0000000..82f6496 --- /dev/null +++ b/includes/external/addressbook/node_modules/domhandler/readme.md @@ -0,0 +1,92 @@ +# domhandler [![Build Status](https://travis-ci.com/fb55/domhandler.svg?branch=master)](https://travis-ci.com/fb55/domhandler) + +The DOM handler creates a tree containing all nodes of a page. +The tree can be manipulated using the [domutils](https://github.com/fb55/domutils) +or [cheerio](https://github.com/cheeriojs/cheerio) libraries and +rendered using [dom-serializer](https://github.com/cheeriojs/dom-serializer) . + +## Usage + +```javascript +const handler = new DomHandler([ callback(err, dom), ] [ options ]); +// const parser = new Parser(handler[, options]); +``` + +Available options are described below. + +## Example + +```javascript +const { Parser } = require("htmlparser2"); +const { DomHandler } = require("domhandler"); +const rawHtml = + "Xyz "; +const handler = new DomHandler((error, dom) => { + if (error) { + // Handle error + } else { + // Parsing completed, do something + console.log(dom); + } +}); +const parser = new Parser(handler); +parser.write(rawHtml); +parser.end(); +``` + +Output: + +```javascript +[ + { + data: "Xyz ", + type: "text", + }, + { + type: "script", + name: "script", + attribs: { + language: "javascript", + }, + children: [ + { + data: "var foo = '';<", + type: "text", + }, + ], + }, + { + data: "