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

Support multiline attributes #1307

Closed
nervecenter opened this issue Oct 29, 2015 · 5 comments
Closed

Support multiline attributes #1307

nervecenter opened this issue Oct 29, 2015 · 5 comments

Comments

@nervecenter
Copy link

Jade currently supports multiline attributes, like so:

input(
    type='checkbox'
    name='agreement'
    checked
)

This would be an excellent feature for Diet.

@burner
Copy link
Contributor

burner commented Jan 18, 2016

that would be great, but I would like to see an additional comma to make the syntax less ambiguous

 input(
    type='checkbox',
    name='agreement',
    checked
)

@burner
Copy link
Contributor

burner commented Jan 20, 2016

I have been looking at the parser and don't see this happening this easy. But a maybe something like:

input(                \
    type='checkbox',  \
    name='agreement', \
    checked           \
)

allows for a preprocessing step to transfrom the above code into a single line similar to Makefiles

@burner
Copy link
Contributor

burner commented Jan 20, 2016

@s-ludwig would that be an option?

@s-ludwig
Copy link
Member

I'd rather not introduce additional syntax due to shortcomings of the current implementation. I'm (slowly) working on a successor implementation, which makes this much easier, so I'd concentrate the effort on that one. It still has to show if it will be able to compile real-world sized templates due to its presumably increased memory use, or if DMD's CTFE engine needs a rewrite first.

@burner
Copy link
Contributor

burner commented Jan 20, 2016

hm, nice to know. I will have a look.

on a site note, adding the backslash thing is properly isn't hard. removeEmptyLines is the place to do it, I think

s-ludwig added a commit to rejectedsoftware/diet-ng that referenced this issue Jul 24, 2017
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

3 participants