Telegram 的即时视图 API:Element <img><p> 不支持 [英] Telegram's instant view API: Element <img> is not supported in <p>
问题描述
我在尝试创建 Telegram 的 Instant View 模板时遇到问题,出现此错误:
元素 <p> 不支持:<img src="mysrc"/>
所以,我决定用 标签替换标签
如果有
标签>
@replace_tag(
但结果没有显示图像.仅供参考, 除了
src
之外没有其他属性.
示例代码:
<p><img src="mysrc"/></p>
我不知道,请帮帮我
你的代码的问题是它取代了 .
就像你说的,你想用 替换
.因此,将标签
替换为
子项.
@replace_tag(
更简单的方法是,
I have problem when trying to create my Telegram's Instant View template, with this error:
Element <img> is not supported in <p>: <img src="mysrc" />
So, I decided to replace tag <p>
if has <img>
tag with <figure>
tag
@replace_tag(<figure>): $body//p//img
But the result is not showing the image. FYI, the <img>
doesn't have attributes except src
.
Sample code:
<p><img src="mysrc"/></p>
I have no idea, please help me
The problem with your code is it replaces the <img>
.
Like what you've said, you want to replace <p>
with <figure>
. So replace the tag <p>
with <img>
children.
@replace_tag(<figure>): $body//p[.//img]
The more simple way is, <figure>: $body//p[.//img]
这篇关于Telegram 的即时视图 API:Element <img><p> 不支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!