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

Qute: demand valid "property" identifiers #11249

Closed
mkouba opened this issue Aug 6, 2020 · 2 comments · Fixed by #11278
Closed

Qute: demand valid "property" identifiers #11249

mkouba opened this issue Aug 6, 2020 · 2 comments · Fixed by #11278
Assignees
Labels
area/qute The template engine kind/enhancement New feature or request
Milestone

Comments

@mkouba
Copy link
Contributor

mkouba commented Aug 6, 2020

Currently, we don't specify any requirements except for the starting char of a tag: https://quarkus.io/guides/qute-reference#identifiers.

Our starting definition could be: a valid identifier is a sequence of characters that contains digits, alphabet characters and underscore.

We should also validate all expressions.

@mkouba mkouba added the kind/enhancement New feature or request label Aug 6, 2020
@mkouba mkouba added this to the 1.8.0 - master milestone Aug 6, 2020
@mkouba mkouba self-assigned this Aug 6, 2020
@quarkusbot quarkusbot added the area/qute The template engine label Aug 6, 2020
@mkouba
Copy link
Contributor Author

mkouba commented Aug 7, 2020

Hm, we'll need to be more lenient because we already use non-standard characters in built-in helpers, e.g. elvis operator: {name ?: 'John'} is translated to name.?:('John'). We could use digits, letters, _ and $ to cover all Java identifiers and add ? and : for now and see how it goes. Alternatively, we could permit any non-whitespace chars.

mkouba added a commit to mkouba/quarkus that referenced this issue Aug 7, 2020
@mkouba
Copy link
Contributor Author

mkouba commented Aug 7, 2020

I think we should permit any non-whitespace chars but encourage users to only use valid Java identifiers.

mkouba added a commit to mkouba/quarkus that referenced this issue Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/qute The template engine kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants