Skip to content

Instantly share code, notes, and snippets.

@michaelwomple
michaelwomple / foster-parent-noDisplay-example
Last active May 2, 2018 19:09
An example of how to get around displaying erroneous html in AMP Templates.
CSS :
<style>
.noDisplay : { display: none; }
</style>
JSON :
{
"items": [{
{
"priceType:"",
@michaelwomple
michaelwomple / foster-parenting-example
Last active May 2, 2018 19:06
An example of foster parenting in AMP List.
JSON:
{
"items": [{
"prices": [
{
"priceType":"Cash",
"price": "1.99",
},
{
"priceType":"Card",
@michaelwomple
michaelwomple / sample-amp-template-after-foster-parenting.html
Last active May 2, 2018 19:03
An example of how an AMP Template works after foster parenting.
<template type="amp-mustache">
{{#prices}}
{{/prices}}
<table>
<tr>
<td>{{priceType}}:</td>
<td>$ {{price}}</td>
</tr>
</table>
@michaelwomple
michaelwomple / sample-amp-template-before-foster-parenting.html
Last active May 2, 2018 19:01
An example of an AMP Template before foster parenting.
<template type="amp-mustache">
<table>
{{#prices}}
<tr>
<td>{{priceType}}:</td>
<td>$ {{price}}</td>
</tr>
{{/prices}}
</table>
</template>
@michaelwomple
michaelwomple / foster-parent-post-render.html
Created April 25, 2018 09:19
The resulting html from our example html due to foster parenting in a table.
<b></b>
<b>bbb</b>
<table>
<tbody>
<tr>
<td>aaa</td>
</tr>
</tbody>
</table>
<b>ccc</b>
@michaelwomple
michaelwomple / foster-parent-html.html
Created April 25, 2018 09:14
Example html of foster parenting in a table. HTML.
<table><b><tr><td>aaa</td></tr>bbb</table>ccc
<table><b><tr><td>aaa</td></tr>bbb</table>ccc