显示从json到AMP页面的原始HTML [英] Display Raw HTML from json to AMP page

查看:48
本文介绍了显示从json到AMP页面的原始HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我正在尝试在现有的产品"页面上实施AMP,但在显示某些数据时我有些卡住.

Currently, I'm trying to implement AMP to an existing Product page and I'm a little bit stuck on displaying some data.

我要显示的字段来自json并包含Raw HTML(如下所示):

The field which I'm trying to display comes from json and contains Raw HTML (something like the following):

description: { '<h1>section title</h1><p>section description</p>' }

在AMP文档中,我找不到有关将上述字符串显示/转换为默认HTML标记的任何信息.

On the AMP documentation I couldn't find any informations about displaying/converting the above string into default HTML tags.

请问我是否可以使用AMP来实现这一目标?

Could you tell me please if there is a way to achieve this with AMP?

推荐答案

您可以使用三重花括号而不是双花括号来呈现原始HTML,例如{{{htmlProperty}}}之类的{{{description}}}

You can render raw HTML by using triple curly braces rather than double, for example {{{htmlProperty}}} like {{{description}}}

<h1>标签不受支持

获取更多信息

这篇关于显示从json到AMP页面的原始HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆