Giter VIP home page Giter VIP logo

Comments (2)

crozone avatar crozone commented on September 3, 2024

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.

Planche95 avatar Planche95 commented on September 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.