Display Raw HTML from json to AMP page

流过昼夜 提交于 2019-12-22 12:19:53

问题


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

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>' }

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

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


回答1:


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

<h1> tag is not supported

For more information



来源:https://stackoverflow.com/questions/53243684/display-raw-html-from-json-to-amp-page

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!