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

control instructions should not be counted as white space #307

Open
pke opened this issue Aug 29, 2021 · 2 comments
Open

control instructions should not be counted as white space #307

pke opened this issue Aug 29, 2021 · 2 comments

Comments

@pke
Copy link

pke commented Aug 29, 2021

Given this template, it should render a CSV output with no empty lines

host,pin,subject
{{~ it :e }}
{{=e.host}},{{=e.hash}},{{=e.subject.CN}}
{{~}}

However, the output contains an empty line after the header and after each of the arrays items.
Currently this template has to be used to get a proper formatted CSV output:

host,pin,subject{{~ it :e }}
{{=e.host}},{{=e.hash}},{{=e.subject.CN}}{{~}}

which is rather ugly.
Will this be fixed in V2?

@strophy
Copy link

strophy commented Oct 6, 2021

This looks like expected behavior to me. The templating engine begins immediately after the delimiter, so the first character it encounters is a newline. The newline will therefore be rendered by the iterator. This is what the engine actually sees, where \n indicates a newline character:

host,pin,subject
{{~ it :e }}\n
{{=e.host}},{{=e.hash}},{{=e.subject.CN}}\n
{{~}}

@udamir
Copy link

udamir commented Aug 28, 2022

Hi, try my fork xdot, I have fixed it

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