@tiki.vn/mini-html-parser2
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

mini-html-parser2

Install

$ npm install @tiki.vn/mini-html-parser2 --save

How to use

// page.js
import parse from '@tiki.vn/mini-html-parser2';

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>`

Page({
  data: {
    nodes: [],
  },
  onLoad() {
    parse(html, (err, nodes) => {
      if (!err) {
        this.setData({
          nodes,
        });
      }
    })
  },
})
<!-- page.txml -->
<rich-text nodes="{{nodes}}" />

Build and test

$ npm run build
$ npm test

Package Sidebar

Install

npm i @tiki.vn/mini-html-parser2

Weekly Downloads

1

Version

0.0.4

License

none

Unpacked Size

44.3 kB

Total Files

10

Last publish

Collaborators

  • hoangtrinhtiki
  • tri-tiki
  • anh.huynh5
  • nghoangvietvn
  • hungnguyentiki
  • kiennt-tiki
  • han.han