<!DOCTYPE html>
<!--
  File: template_test_with_statistics.html
  This file is an exact copy of template_test.html except we want to test statistics html comment generation too.
  Check the associated template_test_with_statistics.html.options.json file to see statistics being switched on.
--><html amp><!-- =AMP-STATS-HEADER= Full HTML document processed by AMP PHP Library (https://github.com/Lullabot/amp-library) at [template] =END-AMP-STATS-HEADER=--><head>
  <meta charset="utf-8">
  <link rel="canonical" href="./regular-template_test.html">
  <meta name="viewport" content="width=device-width,minimum-scale=1">
  <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
  <script async src="https://cdn.ampproject.org/v0.js"></script>
  <script async custom-element="template" src="https://cdn.ampproject.org/v0/amp-mustache-0.1.js"></script>
</head>
<body>
  <template type="amp-mustache">
    <div>hello {{name}}</div>
    <!-- mustache templates are not allowed in attribute names -->
    <p>Rat</p>
    <!-- template partials are not allowed in attribute values and template escapes are not allowed in attribute values -->
    <div></div>
    <!-- template escapes are not allowed in attribute values -->
    <div></div>
    <!--
      template escapes should not be allowed, even in attributes named data-*
      See https://github.com/ampproject/amphtml/issues/3460
    -->
    <div></div>
    <!--
      template partials should not be allowed, even in attributes named data-*
      See https://github.com/ampproject/amphtml/issues/3460
    -->
    <div></div>
    <!-- valid -->
    <div data-something="{{valid}}"></div>
  </template>
</body>

<!-- =AMP-STATS-FOOTER=
Full HTML document processed by AMP PHP Library (https://github.com/Lullabot/amp-library) at [template]
 Time Taken: [template]
 Number of html tags processed: 18
 PHP Peak memory usage before calling convertToAmpHtml: [template]
 PHP Peak memory usage at the end of  convertToAmpHtml: [template] [template]
 * Please note that time taken will increase significantly if you don't have opcache enabled or have XDEBUG enabled.
   Also note that the library downloads initial portions of images to determine dimensions for amp-img tags. 
   If your network is slow, your library processing time will increase and network download time may dominate total time taken for library processing.
=END-AMP-STATS-FOOTER=--></html>


ORIGINAL HTML
---------------
Line  1: <!--
Line  2:   File: template_test_with_statistics.html
Line  3:   This file is an exact copy of template_test.html except we want to test statistics html comment generation too.
Line  4:   Check the associated template_test_with_statistics.html.options.json file to see statistics being switched on.
Line  5: -->
Line  6: <!doctype html>
Line  7: <html amp>
Line  8: <head>
Line  9:   <meta charset="utf-8">
Line 10:   <link rel="canonical" href="./regular-template_test.html" />
Line 11:   <meta name="viewport" content="width=device-width,minimum-scale=1">
Line 12:   <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
Line 13:   <script async src="https://cdn.ampproject.org/v0.js"></script>
Line 14: </head>
Line 15: <body>
Line 16:   <template type="amp-mustache">
Line 17:     <div>hello {{name}}</div>
Line 18:     <!-- mustache templates are not allowed in attribute names -->
Line 19:     <p data-{{cat}}>Rat</p>
Line 20:     <!-- template partials are not allowed in attribute values and template escapes are not allowed in attribute values -->
Line 21:     <div class="{{>something}}}" id="{{{foo}}}"></div>
Line 22:     <!-- template escapes are not allowed in attribute values -->
Line 23:     <div class="{{{bar}}}"></div>
Line 24:     <!--
Line 25:       template escapes should not be allowed, even in attributes named data-*
Line 26:       See https://github.com/ampproject/amphtml/issues/3460
Line 27:     -->
Line 28:     <div data-anything="{{{bar}}}"></div>
Line 29:     <!--
Line 30:       template partials should not be allowed, even in attributes named data-*
Line 31:       See https://github.com/ampproject/amphtml/issues/3460
Line 32:     -->
Line 33:     <div data-foo="{{ >hat}}"></div>
Line 34:     <!-- valid -->
Line 35:     <div data-something="{{valid}}"></div>
Line 36:   </template>
Line 37: </body>
Line 38: </html>
Line 39: 



AMP-HTML Validation Issues and Fixes
-------------------------------------
FAIL

<div class="{{>something}}}" id="{{{foo}}}"> on line 21
- The attribute 'class' in tag 'div' is set to '{{>something}}}', which contains a Mustache template partial.
   [code: TEMPLATE_PARTIAL_IN_ATTR_VALUE  category: AMP_HTML_TEMPLATE_PROBLEM see: https://www.ampproject.org/docs/reference/extended/amp-mustache.html]
   ACTION TAKEN: div.class attribute was removed due to validation issues.
- The attribute 'id' in tag 'div' is set to '{{{foo}}}', which contains unescaped Mustache template syntax.
   [code: UNESCAPED_TEMPLATE_IN_ATTR_VALUE  category: AMP_HTML_TEMPLATE_PROBLEM see: https://www.ampproject.org/docs/reference/extended/amp-mustache.html]
   ACTION TAKEN: div.id attribute was removed due to validation issues.

<div class="{{{bar}}}"> on line 23
- The attribute 'class' in tag 'div' is set to '{{{bar}}}', which contains unescaped Mustache template syntax.
   [code: UNESCAPED_TEMPLATE_IN_ATTR_VALUE  category: AMP_HTML_TEMPLATE_PROBLEM see: https://www.ampproject.org/docs/reference/extended/amp-mustache.html]
   ACTION TAKEN: div.class attribute was removed due to validation issues.

<div data-anything="{{{bar}}}"> on line 28
- The attribute 'data-anything' in tag 'div' is set to '{{{bar}}}', which contains unescaped Mustache template syntax.
   [code: UNESCAPED_TEMPLATE_IN_ATTR_VALUE  category: AMP_HTML_TEMPLATE_PROBLEM see: https://www.ampproject.org/docs/reference/extended/amp-mustache.html]
   ACTION TAKEN: div.data-anything attribute was removed due to validation issues.

<div data-foo="{{ >hat}}"> on line 33
- The attribute 'data-foo' in tag 'div' is set to '{{ >hat}}', which contains a Mustache template partial.
   [code: TEMPLATE_PARTIAL_IN_ATTR_VALUE  category: AMP_HTML_TEMPLATE_PROBLEM see: https://www.ampproject.org/docs/reference/extended/amp-mustache.html]
   ACTION TAKEN: div.data-foo attribute was removed due to validation issues.

GLOBAL WARNING
- Mustache template syntax in attribute name 'data-{{cat}}' in tag 'at location line 19, col 19'.
   [code: TEMPLATE_IN_ATTR_NAME  category: AMP_HTML_TEMPLATE_PROBLEM see: https://www.ampproject.org/docs/reference/extended/amp-mustache.html]
- The tag 'amp-mustache extension .js script' is missing or incorrect, but required by 'template'.
   [code: TAG_REQUIRED_BY_MISSING  category: AMP_TAG_PROBLEM see: https://www.ampproject.org/docs/reference/extended/amp-mustache.html]
   ACTION TAKEN: template custom component script tag added to head

COMPONENT NAMES WITH JS PATH
------------------------------
'template', include path 'https://cdn.ampproject.org/v0/amp-mustache-0.1.js'

