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

Line breaks #38

Open
yonaskolb opened this issue Nov 22, 2016 · 3 comments
Open

Line breaks #38

yonaskolb opened this issue Nov 22, 2016 · 3 comments

Comments

@yonaskolb
Copy link

Hey, great library!
Would it be possible to ignore line breaks in a template when a line only contains a single {{# tag?
This would mean you could write:

enum {{enumName}} { 
    {{#enums}}
    case {{name}} = "{{value}}"
    {{/enums}}
}

instead of

enum {{enumName}} { {{#enums}}
    case {{name}} = "{{value}}"{{/enums}}
}

where you would want each case of that enum to be on a seperate line with no empty lines in between.

It greatly cleans up mustache template files, especially if you have many nested loops

@acecilia
Copy link

@groue I would very much appreciate you feedback on this :)

@groue
Copy link
Owner

groue commented Nov 12, 2019

Well, the source code is here, ready to be modified. Make sure you don't change the runtime just for your convenience, because what's good for you may be a pain for another user. Instead, look at the mustache standard, and plan well your modifications. Ask @fumito-ito if he plans to merge them in the repository before you open a pull request. Happy coding!

@acecilia
Copy link

@groue thanks for your answer.

So far I have solved this issue by using the technique explained in the following comment groue/GRMustache#46 (comment)

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