Open kito99 opened 9 years ago
I wonder if iron-components-page should perhaps strip out comments when it tries to parse an HTML file. I'm using Asciidoctor to generate labs from HTML files, and it chokes on the standard Asciidoc identifiers for code snippets. For example:
<!-- tag::body[] --> <body unresolved> <!--1--> <h1>Hacking Web Components: Polymer Deluxe Counter</h1> <iron-component-page src="deluxe-counter.html"</iron-component-page> <!--2--> </div> </paper-header-panel> </body> <!-- end::body[] -->
This snippet chokes in JSON.parse() in iron-component-page.html:
_loadJson: function() { ... var json = JSON.parse(textContent); },
Full stack trace:
end::body[] SyntaxError: Unexpected token e(…)Polymer._loadJson @ iron-component-page.html:281Polymer.ready @ iron-component-page.html:250Polymer.Base._addFeature._invokeBehavior @ polymer-micro.html:356Polymer.Base._addFeature._doBehavior @ polymer-micro.html:351Polymer.Base._addFeature._readySelf @ polymer-mini.html:80Polymer.Base._addFeature._ready @ polymer-mini.html:67Polymer.Base._addFeature._tryReady @ polymer-mini.html:56Polymer.Base._addFeature._initFeatures @ polymer.html:3221Polymer.Base.createdCallback @ polymer-micro.html:151 iron-component-page.html:277 Uncaught SyntaxError: Unexpected token ePolymer._loadJson @ iron-component-page.html:277Polymer.ready @ iron-component-page.html:250Polymer.Base._addFeature._invokeBehavior @ polymer-micro.html:356Polymer.Base._addFeature._doBehavior @ polymer-micro.html:351Polymer.Base._addFeature._readySelf @ polymer-mini.html:80Polymer.Base._addFeature._ready @ polymer-mini.html:67Polymer.Base._addFeature._tryReady @ polymer-mini.html:56Polymer.Base._addFeature._initFeatures @ polymer.html:3221Polymer.Base.createdCallback @ polymer-micro.html:151
This smells like an escaping problem.
Can you provide a reduced test case to demonstrate the problem?
I wonder if iron-components-page should perhaps strip out comments when it tries to parse an HTML file. I'm using Asciidoctor to generate labs from HTML files, and it chokes on the standard Asciidoc identifiers for code snippets. For example:
This snippet chokes in JSON.parse() in iron-component-page.html:
Full stack trace: