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

the tag containing whitespaces should throw an error #156

Open
l4u opened this issue Oct 17, 2013 · 5 comments
Open

the tag containing whitespaces should throw an error #156

l4u opened this issue Oct 17, 2013 · 5 comments

Comments

@l4u
Copy link

l4u commented Oct 17, 2013

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

Currently, this (pystache 0.5.3) works without errors.

@l4u
Copy link
Author

l4u commented Oct 17, 2013

In ruby's implementation, an error will occur

require 'mustache'
Mustache.render('{{ with space }}', {'with space' => 'content'})

Mustache::Parser::SyntaxError: Unclosed tag

@l4u
Copy link
Author

l4u commented Oct 17, 2013

@bobthecow
Copy link

According to the spec, that's a valid tag name. The only things that a tag name can't contain are . and the closing delimiter (and they can't start with any of the tag sigils — &, =, >, etc — unless they're inside a tag that already has a sigil, so I'd avoid starting with them regardless).

I'd consider this a bug in the Ruby implementation :)

@l4u
Copy link
Author

l4u commented Aug 27, 2014

An Objective-C implementation (https://github.com/groue/GRMustache) and a ruby implementation (https://github.com/mustache/mustache) do not allow spaces.
While this python implementation, or possibly your php implementation allow spaces.
I hope that someone could clarify the specs.

@bobthecow
Copy link

If you have a python dictionary or a PHP associative array with spaces in the keys, it's perfectly valid to use tags with spaces to get at them.

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

2 participants