Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowing boolean attributes #160

Closed
planetoftheweb opened this issue Feb 3, 2013 · 3 comments
Closed

Allowing boolean attributes #160

planetoftheweb opened this issue Feb 3, 2013 · 3 comments

Comments

@planetoftheweb
Copy link

When I type the following text into an editor that understands emmet:

div.fragment>pre>code.javascript[contenteditable]
it expands to:

<div class="fragment">
    <pre><code class="javascript" contenteditable=""></code></pre>
</div>

Which is almost perfect, except that the boolean attribute shouldn't have the quotes. Would it be possible modify the statement above so that it creates nodes with boolean attributes with no values. Right now, I have to manually delete the ="" sign. Thanks

<div class="fragment">
    <pre><code class="javascript" contenteditable></code></pre>
</div>
@ninique
Copy link

ninique commented Jun 7, 2013

+1

I find this especially annoying when developing for AngularJS, where have a lot of directives that are attributes without values.

@narrowdesign
Copy link

Yes please.

sergeche added a commit that referenced this issue Oct 29, 2013
Users can dot after attribute name in expression to mark this attribute as boolean (e.g. name and value are equal). Depending on preferences, the `div[attr.]` expression can be transformed into `<div attr="attr">` or `<div attr>`

Also, `profile.allowCompactBoolean` and `profile.booleanAttributes` were added to add more control and convenience for users.

Closes #160
@tucq88
Copy link

tucq88 commented Jul 15, 2016

Awesome. This should be include in cheatsheet or official guide. It's very helpful in the world of AngularJS/ReactJS now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants