We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
html ast解析算法的过程是将一段html字符串,解析成一个javascript对象。
<div> <input r-value="{name}" /> <p> <span></span> <span style="display:block;"> 描述信息2 <span>{name}</span> </span> </p> </div>
整体实现分析:
<div>
<p>
<input />
</div>
</p>
代码思路:
div
</span>
分布解析的动态demo,代码每一步都有详细的解释:
online demo
github源码
by Kaola nrz
The text was updated successfully, but these errors were encountered:
No branches or pull requests
title: 实现一个简单的html ast解析算法
date: 2017-05-23
概述
html ast解析算法的过程是将一段html字符串,解析成一个javascript对象。
示例字符串
思路分析
整体实现分析:
<div>
,<p>
等,自闭合标签<input />
,闭合标签</div>
,</p>
等代码思路:
div
开标签,push进数组</span>
结束标签,表示后面的标签需要加入到p.children而不是span.children代码实现
分布解析的动态demo,代码每一步都有详细的解释:
online demo
github源码
by Kaola nrz
The text was updated successfully, but these errors were encountered: