Handlebars inside class tag removed even with raw tag
See original GitHub issueFor some reason the handlebars inside the class tag get removed. I’ve tried both <raw>
and using the @{}
syntax. <div class="{{name}}" id="{{name}}">
becomes <div class="name" id="{{name}}">
<raw>
<amp-list layout="container" src="json/items.json">
<template type="amp-mustache">
<div class="grid">
{{#items}}
<div class="{{name}}" id="{{name}}"> <!-- LOOK HERE -->
<button class="day-label">{{name}}</button>
</div>
{{/items}}
{{^items}}
<div>No items found.</div>
{{/items}}
</div>
</template>
<div placeholder>Loading ...</div>
<div fallback>Failed to load data.</div>
</amp-list>
</raw>
<amp-list layout="container" src="json/items.json">
<template type="amp-mustache">
<div class="grid">
{{#items}}
<div class="name" id="{{name}}"> <!-- LOOK HERE -->
<button class="day-label">{{name}}</button>
</div>
{{/items}}
{{^items}}
<div>No items found.</div>
{{/items}}
</div>
</template>
<div placeholder="">Loading ...</div>
<div fallback="">Failed to load data.</div>
</amp-list>
Issue Analytics
- State:
- Created a year ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Expressions | Handlebars
Escaping Handlebars expressions Handlebars content may be escaped in one of two ways, inline escapes or raw block helpers. Inline escapes ...
Read more >Handlebars raw tags not working · Issue #6052 - GitHub
There seems to be an issue in raw og triple mustache tags fixed in issue #5957 ... it doesn't work in the demo...
Read more >Handlebars each loop not working despite all other objects ...
This will render everything between the {{{{raw}}}} tags as it written, removing the need for the \ prefix before every Handlebars expression.
Read more >Handlebars Helpers for Custom Templates - HelpDocs Support
Block helpers can help you do conditional statements and loops. You prefix the helper name with a hash, and write extra HTML (or...
Read more >Use a Custom Handlebars Template to Display List Items
Outer div tag must have id="{{divId}}" data-item="{{itemId}}" attributes · Delete/remove a link can be changed to a button or whatever, but the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
OK, but keep in mind that escaped class names like
w-3\/4
will break your layout in Gmail (it throws away the entire style tag or style attribute where it finds CSS that it doesn’t support). So I’d advise to not go into production withsafeClassNames
completely disabled 😃For now, I’ve done:
safeClassNames: false,
but I’ll check out the next release when it’s available