question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Handlebars inside class tag removed even with raw tag

See original GitHub issue

For 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:closed
  • Created a year ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
cossssmincommented, Oct 13, 2022

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 with safeClassNames completely disabled 😃

1reaction
tettoffensivecommented, Oct 13, 2022

For now, I’ve done: safeClassNames: false, but I’ll check out the next release when it’s available

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found