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

Variable name with spaces #63

Closed
l4u opened this issue Oct 17, 2013 · 9 comments
Closed

Variable name with spaces #63

l4u opened this issue Oct 17, 2013 · 9 comments

Comments

@l4u
Copy link

l4u commented Oct 17, 2013

Not sure if this is in the spec, but the python implementation pystache can render {{ variable name}}.

import pystache
print pystache.render('{{ with space }}',{'with space':'content'})

Is there any way we can render this in GRMustache without throwing an error for compatibility? Because I got data in this format.
Thanks!

@groue
Copy link
Owner

groue commented Oct 17, 2013

Hi l4u,

From https://github.com/mustache/spec/blob/master/specs/interpolation.yml :

The tag's content MUST be a non-whitespace character sequence NOT containing the current closing delimiter.

So, no, I won't update GRMustache for that.

I would instead open an issue in the pystache repo, so that no more people get bitten by this inconsistency.

Sorry. I hope you don't have too many keys to update.

@groue groue closed this as completed Oct 17, 2013
@l4u
Copy link
Author

l4u commented Oct 17, 2013

Thanks, I've posted it at defunkt/pystache#156

@l4u
Copy link
Author

l4u commented Oct 17, 2013

@groue may I know which file/lines I should look into?
I know this isn't following the specs but I will have to parse those malformed data.

@groue
Copy link
Owner

groue commented Oct 17, 2013

@l4u I did not understand your last question. How may I help you?

@l4u
Copy link
Author

l4u commented Oct 17, 2013

I am trying to allow tags with white spaces.
seems that it works if I remove the line at
dcaa98a#diff-203bc92a75f3e65b4230515df363c513R208
I am not saying this should be merged 😄 it's just for my special use case

@groue
Copy link
Owner

groue commented Oct 17, 2013

I guess it would work, yes. So go ahead if you prefer this option.

@groue
Copy link
Owner

groue commented Oct 17, 2013

Of course the best option is to stop using white spaces in your keys, and this is what I advise you to do.

@l4u
Copy link
Author

l4u commented Oct 17, 2013

Yeah, but unfortunately the mustache templates are out of my control. They are from 3rd parties. 😢

@groue
Copy link
Owner

groue commented Oct 17, 2013

Well, in that case... You can send them the links to the pystache issue, and to the spec (https://github.com/mustache/spec/blob/master/specs/interpolation.yml). So that they stop producing invalid templates. Eventually. Maybe 😄

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