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

Stash Set/Append and Whitespace #61

Open
leigeber opened this issue Sep 20, 2013 · 6 comments
Open

Stash Set/Append and Whitespace #61

leigeber opened this issue Sep 20, 2013 · 6 comments

Comments

@leigeber
Copy link

I am trying to build out a query for the query module and despite having a trailing/leading whitespacing when setting or appending it gets stripped. I thought trim was set to no by default but even specifically setting it doesn't seem to help. Any thoughts? Thanks.

@leigeber
Copy link
Author

Scratch this, I'm pretty sure this was blatant user error. Sorry for the false alarm.

@leigeber
Copy link
Author

Actually I was just able to replicate this...

{exp:stash:set name="test"}
test
{/exp:stash:set}
{exp:stash:append name="test" trim="no"}
123
{/exp:stash:append}
{exp:stash:get name="test"}

If you have a line break on both the gap between test and 123 closes. If you close up either the set or the append it opens back up. Strange..

@leigeber leigeber reopened this Sep 20, 2013
@croxton
Copy link
Owner

croxton commented Sep 20, 2013

Stash doesn't do any trimming unless you specifically ask it to. EE trims whitespace in params automatically, but I didn't think it did that for tagdata enclosed by a tag pair, unless that's changed.

Are you testing this on windows or mac? EE 2.7?

@leigeber
Copy link
Author

EE 2.7 w/ Windows. Thanks.

@croxton
Copy link
Owner

croxton commented Sep 24, 2013

It's a windows line-break thing for sure, but Stash isn't doing anything other than concatenating the strings it gets passed when it appends/prepends. It could be EE's template class that's causing this behaviour. I have a windows box somewhere so I'm going to do some tests and see if I can work out where this is happening.

@croxton
Copy link
Owner

croxton commented Dec 6, 2013

Wasn't able to reproduce this on my windows box. Leaving open in case anyone can shed light.

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

No branches or pull requests

2 participants