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.

Adding the AMP boolean attributes to the attributes module

See original GitHub issue

I am trying to render an AMP HTML page using snabbdom. AMP has some custom boolean attributes: amp, ⚡, amp-boilerplate (might be more, I don’t know yet).

Would it be fine to add those attributes to the list of boolean attributes here

Note: currently snabbdom renders those as amp="true" and that does not pass the AMP validator.


I can work on a fork and try to make all the necessary changes that need to be done for snabbdom to be able to render AMP-compliant pages

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
paldepindcommented, Jul 27, 2017

Thank you for reporting this issue @zkochan. The latest release now handles custom boolean attributes seamlessly.

h("div", { attrs: { amp: true} } results in <div amp>.

1reaction
fix-fixcommented, Jun 13, 2017

Yes, but I don’t think that module should replace attributes module, but instead there should be a special way for providing AMP (and maybe some other non-standard) attributes to VNodes (not in the data property), that can be used alongside default attributes module.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom component in Angular 6: values to boolean attributes
I'm developing a web application using Angular 6. I have a question: I would like to create some custom components that are inspired...
Read more >
Documentation: <amp-bind> - amp.dev
Hide and reveal and element using the [hidden] attribute. A [hidden] expression should be a boolean expression. Hello there! Hide Show.
Read more >
Support boolean attributes in drupal_attributes() [#2847484]
drupal_attributes() should allow boolean values and should output in a way that is consistent with the boolean attribute definition in HTML5 ...
Read more >
Boolean attributes on Web Components · Issue #9230 - GitHub
When setting boolean attributes on Web Components they get rendered as attribute/value pairs instead This causes problems with some AMP ...
Read more >
HubL Tags - HubSpot Developers
Boolean. A boolean tag creates a checkbox in the UI that prints "true" or "false." In addition to printing the value, this module...
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