# mini-html-parser2

> 小程序富文本

Latest version **0.3.0** (published 2021-05-07) · 0 weekly downloads

## Install

```sh
npm install mini-html-parser2
pnpm add mini-html-parser2
yarn add mini-html-parser2
bun add mini-html-parser2
```

## 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.3.0 |
| Published | 2021-05-07 |
| First published | 2018-09-12 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 43.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 72 |
| Author | issac.lj@alibaba-inc.com |
| Maintainers | pingan1927, issac.lj |
| Keywords | rich-text, mini-program, html-parser |

## Links

- npm: https://www.npmjs.com/package/mini-html-parser2
- Repository: https://github.com/ant-mini-program/mini-html-parser
- Homepage: https://github.com/ant-mini-program/mini-html-parser#readme
- Issues: https://github.com/ant-mini-program/mini-html-parser/issues
- npm.io page: https://npm.io/package/mini-html-parser2

## Dependencies (3)

- [events](https://npm.io/package/events.md) ^3.0.0
- [entities](https://npm.io/package/entities.md) ^1.1.1
- [domhandler](https://npm.io/package/domhandler.md) ^2.4.2

## 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.3.0 (latest) — 2021-05-07
- 0.2.0 — 2020-03-25
- 0.1.4 — 2019-04-15
- 0.1.3 — 2019-03-01
- 0.1.2 — 2019-03-01
- 0.1.1 — 2019-03-01
- 0.1.0 — 2018-09-12

## README

# mini-html-parser2

## 安装

```
$ npm install mini-html-parser2 --save
```

## 使用

```js
// page.js
const html = `<div>
<span>test</span>
<div>
    <span>table test</span>
    <table>
        <thead>
            <tr>
                <th>title</th>
                <th>title</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td colspan="2">yy</td>
                <td>xx</td>
                <td>xx</td>
                <td>xx</td>
            </tr>
        </tbody>
    </table>
</div>
</div>`
import parse from 'mini-html-parser2';

Page({
  data: {
    nodes: [],
  },
  onLoad() {
    parse(html, (err, nodes) => {
      if (!err) {
        this.setData({
          nodes,
        });
      }
    })
  },
})
```

```html
<!-- page.axml -->
<rich-text nodes="{{nodes}}" />
```

## 运行测试

```
$ npm run build
$ npm test
```

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