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

Attributes without values not being expanded #218

Closed
typoon opened this issue Jul 17, 2014 · 5 comments
Closed

Attributes without values not being expanded #218

typoon opened this issue Jul 17, 2014 · 5 comments

Comments

@typoon
Copy link
Contributor

typoon commented Jul 17, 2014

Hello,

I tried the following syntax, as in the emmet documentation, but the result is not as expected:
div[foo bar]

Expected:
<div foo="" bar=""></div>

Result:
<div></div>

Is this a bug or did I miss something?

Thanks!

@mattn mattn closed this as completed in 0f45689 Jul 18, 2014
@typoon
Copy link
Contributor Author

typoon commented Jul 18, 2014

The fix isn't totally correct. What happens now is:

div[foo bar] returns <div foo bar></div> when the expected would be <div foo="" bar=""></div>. Could you have a look?

Thanks!

@mattn
Copy link
Owner

mattn commented Jul 18, 2014

Do you want to expand div[disabled] into <div disabled=""></div> ?

@typoon
Copy link
Contributor Author

typoon commented Jul 18, 2014

According to emmet's documentation, section Custom Attributes, that is the expected behaviour:

You don’t have to specify attribute values: td[colspan title] will produce 
<td colspan="" title=""> with tabstops inside each empty attribute 
(if your editor supports them).

@typoon
Copy link
Contributor Author

typoon commented Jul 18, 2014

Thinking about it, perhaps it would be nice to have some kind of configuration where I can define what attributes shouldn't have the ="" appended to it, as you made a really good point in the case of the disabled attribute.
I believe that by default all attributes should receive the ="", and the ones specified in the configuration array shouldn't, so we could have an array like ['disabled', 'selected'], that would cause these two attributes not to receive the ="" part.

What do you think?

@mattn mattn reopened this Jul 18, 2014
@mattn
Copy link
Owner

mattn commented Jul 18, 2014

OK, playground on docs.emmet.io seems to be same as your said.

@mattn mattn closed this as completed in 2b94508 Jul 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants