我有很多这样的字符串
"x _I _aaa 1. _cool. value1, value2, value3, value4; o> lorem ipsum, delirium; o> Cogito ergo sum o> homo homini lupus est. 2. _warm. value5, valu6, valu7; o> amore ipsum lorem mortem. _II _bbb 1. _grey. one; two. three;"
我想看到这样的:
x
I _aaa
1. _cool. value1, value2, value3, value4;
а> lorem ipsum, delirium;
б> Cogito ergo sum;
в> homo homini lupus est.
2. _warm. value5, valu6, valu7;
а> amore ipsum lorem mortem.
II _bbb
1. _grey. one; two. three;
所以我需要将字符串翻译成html:
<p class="a">x</p>
<p class="b">I _aaa</p>
<ul class="c">
<li class="d">_cool. value1, value2, value3, value4;
<ul class="f">
<li class="e">lorem ipsum, delirium; </li>
<li class="e">Cogito ergo sum </li>
<li class="e">homo homini lupus est. </li>
</ul> </li>
<li class="d">_warm. value5, valu6, valu7; </li>
<li class="e">а> amore ipsum lorem mortem. </li>
</ul>
<p class="b">II _bbb</p>
<ul class="c">
<li class="d">_grey. one; two. three; </li>
</ul>
该数据格式是否有名称(如 CSV、XML)?
也许有一个解析它的库?
你认为完成这项工作的最佳方式是什么?