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

Don't print `class` attribute with empty value for Diet template #372

Closed
ilya-stromberg opened this Issue Nov 4, 2013 · 1 comment

Comments

Projects
None yet
3 participants
@ilya-stromberg
Contributor

ilya-stromberg commented Nov 4, 2013

It's a d9iffetense between Diet and Jade.

Diet template:

body(class='')

<body class=""></body>

Jade template:

body(class='')

<body></body>

It's useful to decrease HTML size when I have to print class value by condition:

- bool condition = false;
    body(class=condition ? "value" : "")

Probably, it will be also useful for other attributes (maybe for all except boolean attributes like checked)

See also Attributes section of Jade template:
http://jade-lang.com/reference/

@japplegame

This comment has been minimized.

Show comment
Hide comment
@japplegame

japplegame Nov 5, 2013

Contributor

Yes. Diet should not render empty attributes. I'm trying to implement this feature.

Contributor

japplegame commented Nov 5, 2013

Yes. Diet should not render empty attributes. I'm trying to implement this feature.

nazriel added a commit to nazriel/vibe.d that referenced this issue Feb 13, 2014

s-ludwig added a commit that referenced this issue Feb 13, 2014

Merge pull request #519 from nazriel/issue372
Fix issue #372: Don't print `class` attribute with empty value for Diet ...

@s-ludwig s-ludwig closed this Feb 13, 2014

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