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

Inconsistent newlines when section value is in a list #19

Open
richfitz opened this issue Jul 30, 2014 · 0 comments
Open

Inconsistent newlines when section value is in a list #19

richfitz opened this issue Jul 30, 2014 · 0 comments

Comments

@richfitz
Copy link

There is an inconsistency in the whitespace generated by these two templates:

str1 <- 'header
{{#query}}
holla
{{/query}}
footer'
str2 <- 'header
{{#obj.query}}
holla
{{/obj.query}}
footer'

(the only difference is that the section variable is within a list obj in the second version).

This version gives what I would expect:

library(whisker)
whisker.render(str1, list(query=TRUE))  # "header\nholla\nfooter"
whisker.render(str1, list(query=FALSE)) # "header\nfooter"

While the second version generates extra newlines:

library(whisker)
whisker.render(str2, list(obj=list(query=TRUE)))  # "header\n\nholla\n\nfooter"
whisker.render(str2, list(obj=list(query=FALSE))) # "header\n\nfooter"

This does not affect the version from CRAN (0.3-2).

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

1 participant