# parsoid-dom-utils

> A collection of utilities for working with HTML DOM emitted by Parsoid

Latest version **0.1.3** (published 2017-04-27) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install parsoid-dom-utils
pnpm add parsoid-dom-utils
yarn add parsoid-dom-utils
bun add parsoid-dom-utils
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2017-04-27 |
| First published | 2017-04-26 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Gabriel Wicke |
| Maintainers | gwicke |
| Keywords | parsoid, html, mediawiki, wikipedia |

## Links

- npm: https://www.npmjs.com/package/parsoid-dom-utils
- Repository: https://github.com/gwicke/parsoid-dom-utils
- Homepage: https://github.com/gwicke/parsoid-dom-utils#readme
- Issues: https://github.com/gwicke/parsoid-dom-utils/issues
- npm.io page: https://npm.io/package/parsoid-dom-utils

## Dependencies (1)

- [domino](https://npm.io/package/domino.md) ^1.0.20

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 0.1.3 (latest) — 2017-04-27
- 0.1.2 — 2017-04-26

## README

# parsoid-dom-utils [![Build Status](https://travis-ci.org/gwicke/parsoid-dom-utils.svg?branch=master)](https://travis-ci.org/gwicke/parsoid-dom-utils)

A collection of utilities for working with HTML DOM emitted by Parsoid

## Section wrapping

Wraps logical sections defined by headings into &lt;section> tags. Different
heading levels produce nested sections. In the final document, the children of
the `body` element are a sequence of `section`s.

```javascript
const domino = require('domino');
const domUtils = require('parsoid-dom-utils');

const testHTML = '<h1>Heading 1</h1><p>Paragraph</p>'
    + '<h2>Heading 2</h2><p>More content</p>'
    + '<h1>Another heading 1</h1><p>More paragraph content</p>';
const doc = domino.createDocument(testHTML);
const wrappedDocHTML = domUtils.sections.wrap(doc).outerHTML;

// <html><head></head><body>
// <section><h1>Heading 1</h1><p>Paragraph</p>
// <section><h2>Heading 2</h2><p>More content</p></section></section>
// <section><h1>Another heading 1</h1><p>More paragraph content</p></section>
// </body></html>
```

---
_Source: https://npm.io/package/parsoid-dom-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
