1 Star 0 Fork 0

gitee_zhangp / htmlparser

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

html-parser

功能

  • 实现html词法分析,将html结构文件转换为对应层级的json数据,可以修改数据并生成新的html文件。
    // 参考
    <div class="text-white" style="color: white;">hello</div>
    // 转化为
    {
      name: 'div',
      tag: 'element',
      attrs: { class: 'text-white', style: 'color: white' },
      children: [{
        name: 'hello',
        tag: 'text',
        children: []
      }]
    }
  • 其中$on方法可以监听标签打开和关闭事件,并接受回调函数处理自定义逻辑。
  • 兼容处理未合法闭合的标签。

Repository Comments ( 0 )

Sign in to post a comment

About

html 抽象语法库 expand collapse
Cancel

Releases

No release

Contributors

All

Activities

Load More
can not load any more
JavaScript
1
https://gitee.com/gitee_zhangp/htmlparser.git
git@gitee.com:gitee_zhangp/htmlparser.git
gitee_zhangp
htmlparser
htmlparser
master

Search