Giter VIP home page Giter VIP logo

Comments (6)

JanDeDobbeleer avatar JanDeDobbeleer commented on September 13, 2024 1

@Bilge it's the destination that matters, not the journey. Or something like that. Who knows.

from oh-my-posh.

JanDeDobbeleer avatar JanDeDobbeleer commented on September 13, 2024

@Bilge as we rely on a third party parser, I'm going to see if we can solve this, or if they have a bug. Thanks for reporting this one.

from oh-my-posh.

JanDeDobbeleer avatar JanDeDobbeleer commented on September 13, 2024

@Bilge this is an annoying one. I understand the request and I can fix it by adjusting the parser BUT, it's going against the YAML spec this way. The parser has no way to quote all strings, it decides based on the content which could imply that the following JSON export:

{ "key": "~" }

can originate from the following YAML:

key: ~

and be entirely correct.

So, I will hack this in for oh-my-posh specifically, but it's a project specific hack.

from oh-my-posh.

Bilge avatar Bilge commented on September 13, 2024

Incorrect. The following YAML:

key: ~

Is equivalent to the following JSON:

{"key": null}

This is documented in the YAML parser spec I previously linked. So no, this is not a project-specific hack, it's correctly interpreting the spec for any use. In particular:

null | Null | NULL | ~ tag:yaml.org,2002:null

Note that the ~ is listed as a valid representation of null.

from oh-my-posh.

JanDeDobbeleer avatar JanDeDobbeleer commented on September 13, 2024

@Bilge so, from JSON, and any other model that doesn't have a magical notation for ~, it needs to always parse to "~". In that case my hack is actually a fix.

from oh-my-posh.

Bilge avatar Bilge commented on September 13, 2024

Yes, you arrived at the good solution, just possibly for the wrong reasons. 🤷🏻‍♂️

from oh-my-posh.

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.