如何在 Telegram 的即时视图 API 中删除标签的属性?
How to remove attribute of a tag in Telegram's instant view API?
我有这个
<span class="img-fc">
<img src="https://img1.ibxk.com.br/2017/04/12/12095959053024.png?w=700">
<span class="desc">The image desc is here!</span>
</span>
所以我使用了API的一些函数来修改描述
<figure>: //span[@class="img-fc"]
<figcaption>: //figure[@class="img-fc"]/span[@class="desc"]
我在即时视图调试中得到了这个结果:
> @debug: $body//figure
Debug 1 node:
[0]: <figure class="img-fc"><img src="https://img1.ibxk.com.br/2017/04/12/12095959053024.png?w=700"><figcaption class="desc">The image desc is here!</figcaption></figure>
Instant View successfully generated
但是,它不会生成图片下方带有标题的 img。
这是结果:
第一步:将<span class="img-fc">
标签中的所有<span class="desc">
标签转换为<figcaption>
标签:
<figcaption>: //span[has-class("img-fc")]//span[has-class("desc")]
第二步也是最后一步是将所有 <span class="img-fc">
标签转换为 <figure>
:
<figure>: //span[has-class("img-fc")]
我有这个
<span class="img-fc">
<img src="https://img1.ibxk.com.br/2017/04/12/12095959053024.png?w=700">
<span class="desc">The image desc is here!</span>
</span>
所以我使用了API的一些函数来修改描述
<figure>: //span[@class="img-fc"]
<figcaption>: //figure[@class="img-fc"]/span[@class="desc"]
我在即时视图调试中得到了这个结果:
> @debug: $body//figure
Debug 1 node:
[0]: <figure class="img-fc"><img src="https://img1.ibxk.com.br/2017/04/12/12095959053024.png?w=700"><figcaption class="desc">The image desc is here!</figcaption></figure>
Instant View successfully generated
但是,它不会生成图片下方带有标题的 img。
这是结果:
第一步:将<span class="img-fc">
标签中的所有<span class="desc">
标签转换为<figcaption>
标签:
<figcaption>: //span[has-class("img-fc")]//span[has-class("desc")]
第二步也是最后一步是将所有 <span class="img-fc">
标签转换为 <figure>
:
<figure>: //span[has-class("img-fc")]