【发布时间】:2018-07-31 00:29:29
【问题描述】:
所以我有这种格式的html字符串:
Our society reflects, and is a reflection of, the <del>individual</del><add>person</add> (you and I) , and the <del>individual</del><add>person</add> is a <del>reflection</del><add>manifestation</add> of society (hologram/holon ).
我想把它们解析成像吹这样的节点:
Our society reflects, and is a reflection of, the
<del>individual</del>
<add>person</add>
(you and I) , and the
<del>individual</del>
<add>person</add>
is a
<del>reflection</del>
<add>manifestation</add>
of society (hologram/holon ).
我知道你可以这样做:
var element = document.createElement( 'html' );
element.innerHTML = html
nodes = element.childNodes
但在本机反应中,我得到了can't find variable: document,看来我需要web-view 才能做到这一点。有没有其他方法可以解析这个字符串?
【问题讨论】:
标签: javascript html react-native