Skip to content

Can't use templating in files with curly braces {} #34

@bnheise

Description

@bnheise

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:

const myObj = { 
  projectName: "{project_name}"
};

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions