-
Notifications
You must be signed in to change notification settings - Fork 13
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
custom braces as string, not char - {{ }} << >> #24
Comments
Passing strings as the brace parameter is not supported. This is because the library is hardcoded to assume that a pair of either brace character is an escaped brace, and strings do not conform nicely to this pattern. For example, if the brace characters are '{' and '}', they are escaped using "{{" "}}". There is no ambiguity because all literal braces should be escaped before the string is parsed. An input such as "{{{param}}}" will be correctly parsed as "{" + param + "}". I'm interested in the scenario where multi-character braces is required. If we were to allow "{{" and "}}" as the braces, how should they be escaped without introducing ambiguities? |
Hi sorry for the late response. I was looking at different libraries that will give me the possibility to parametrize jsons. I use to use handlebars for it https://github.com/Handlebars-Net/Handlebars.Net, but it doesn't have build in functionality to get all parameter names from file. In handlebars, default braces are "{{", "}}", and if you want to escape them you just add "" before them, like "{{". In my case where I have json with random strings in it it's hard to choose only one brace, for example:
I feel there is too much probability that "one char" open and close braces will be generated in my random strings and then I will end up with not wanted parameters. If I would use string as braces it would lower this probality. I'm not saying one brace is bad, but how should I handle this situation then? |
Hi, is it possible to use string as braces not char? Like {{ }} << >>? Using only one character is risky, you can end up with unwanted parameters.
The text was updated successfully, but these errors were encountered: