问题
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