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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Key names with special characters and whitespace #236

Open
aymericbouzy opened this issue Jun 8, 2017 · 1 comment
Open

Key names with special characters and whitespace #236

aymericbouzy opened this issue Jun 8, 2017 · 1 comment

Comments

@aymericbouzy
Copy link

My template :

{{#馃殌}}
  launch!
{{/馃殌}}

My dictionary :

{
  "馃殌" => true
}

I would expect the following result :

launch!

Instead I get the error :

Mustache::Parser::SyntaxError: Illegal content in tag
  Line 1
    {{#馃殌}}
      ^

This example succeeds on https://mustache.github.io/#demo

I get the same error with the following keys (instead of 馃殌) : "Foo Bar", "J茅sus", ...

@drewish
Copy link
Contributor

drewish commented Mar 2, 2018

I think that's because of the regex used for the ALLOWED_CONTENT constant:

ALLOWED_CONTENT = /(\w|[?!\/.-])*/

Per the regex docs

/\w/ - A word character ([a-zA-Z0-9_])

Which would prevent the emoji, space or accented character you listed.

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