Comments (2)
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?
from formatwith.
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:
{
"random" : "{asd<f(v)vvbm>lkk}",
"random2" : "asda)>}xc"
}
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?
from formatwith.
Related Issues (20)
- Breaking changes for 2.0 release HOT 4
- Span<T> goodness HOT 2
- Just a thank you. HOT 1
- Formatting with SubProperties HOT 1
- Problem with GetFormatParameters() HOT 1
- Updated release? HOT 4
- Assembly signing / strong naming HOT 4
- Suggest using IReadOnlyDictionary<> instead of IDictionary<> HOT 3
- Nested arguments HOT 4
- Add Support for generic value dictionaries HOT 5
- Add support for indexers (support for Arrays/Lists/Dictionaries/etc) HOT 1
- Additional formatting options.
- Vectorize the tokenizer HOT 1
- Handle whitespace padding around parameters
- Allow passing in StringComparer or StringComparison for object based lookups
- Define the CultureInfo of the format HOT 2
- Q: Is this project still alive? HOT 1
- [Feature Request] Add a type that tokenizes the string once, and reuse it for processing parameters. HOT 2
- [Feature Request] Allow inclusion of alignment in formatting HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from formatwith.