-
Notifications
You must be signed in to change notification settings - Fork 51
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
Can't use templating in files with curly braces {} #34
Comments
Similar issue, but with CSS. I've got a |
@bnheise I'm literally having the exact same problem as you. Want to inject values into a JSON template, but it seems it's impossible. FWIW I started using handlebars-rust but I got into a state where rendering an array was not forming a correct JSON Object so just decided to move to this, which seems to not work at all 🤣 Gonna jump back to Handlebars, hope they fix this in a near future, I don't see this as an invalid use case tbh |
Maybe leon will fix your problem? |
Escaping curly braces is supported, as documented here, like this .class-example \{
color: blue
} |
I'm not sure if this is specific to the file I was working with or if it applies to all file that use curly braces, but I wanted to bring it up anyway.
It seems TinyTemplate uses just opening and closing curly braces { } to denote places to insert values into the template file.
I'm working on a project that generates a JavaScript project workspace and needs to insert some values into a few default JS files. However, when I try to use a JS file as a template, the TinyTemplate errors out, telling me that a matching curly brace is missing.
I have some JS like this:
TinyTemplate should insert the value of project_name into this JS object, but TinyTemplate sees the opening brace of myObj as as signaling the start of an injection point for the templating engine and then breaks when it sees the first opening brace of the actual injection point.
Personally, I'd love to use TinyTemplate for my project because I really only need minimal templating capabilities so other options would bloat out my app unnecessarily. Are there any plans in the future to make TinyTemplate compatible with JavaScript files and other formats that use curly braces extensively?
The text was updated successfully, but these errors were encountered: