Nuns Playing Monopoly

    @peacejj/mini-html-parser2

    0.3.2 • Public • Published

    mini-html-parser2

    背景

    fork项目阿里项目mini-html-parser,重新编译把依赖打包到一起。

    版本

    本版本0.3.x 对应官网0.3.0

    安装

    $ npm install @peacejj/mini-html-parser2 --save
    

    使用

    // 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 '@peacejj/mini-html-parser2';
    
    Page({
      data: {
        nodes: [],
      },
      onLoad() {
        parse(html, (err, nodes) => {
          if (!err) {
            this.setData({
              nodes,
            });
          }
        })
      },
    })
    <!-- page.axml -->
    <rich-text nodes="{{nodes}}" />

    运行测试

    $ npm run build
    $ npm test
    

    Install

    npm i @peacejj/mini-html-parser2

    DownloadsWeekly Downloads

    4

    Version

    0.3.2

    License

    none

    Unpacked Size

    35.4 kB

    Total Files

    3

    Last publish

    Collaborators

    • peacejj