Skip to content
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

fails to parse yaml block which includes a string with newlines #17

Open
keithamus opened this issue Nov 7, 2015 · 3 comments
Open
Labels
Milestone

Comments

@keithamus
Copy link

Summary

A yaml value supposedly can contain newline literals, which should be stripped out as part of the yaml value. tap-out crashes if it attempts to parse such a value.

So apparently the following is valid:

a: b
    c

and should result in the following json:

{
  "a": "b c"
}

in fact, on yaml.org within the first few lines it is demonstrated:

What It Is: YAML is a human friendly data serialization
  standard for all programming languages.

It seems to be in YAML 1.2 Example 2.18

Proposal

Currently the parser has a custom YAML parser included, which seemingly does not adhere to the YAML spec. I would suggest instead collecting the lines between --- and ... and passing them straight into a yaml parser. My suggestion would be to go with js-yaml as it claims to be 1.2 compliant and is actively maintained, has lots of github stars, and nearly 5 million npm downloads a month.

@scottcorgan
Copy link
Owner

I have been working on a collection of packages under the org tap-format as sequels to my few tap-[formatter] modules.

https://github.com/tap-format/parser will be the replacement for this. It's basically done, just needs documentation.

@keithamus
Copy link
Author

Great work @scottcorgan! Kudos 😀. Does that mean that tap-out is deprecated?

@scottcorgan
Copy link
Owner

@keithamus it will be deprecated, but not quite yet. Once the tap-format modules are all polished and documented, then I'll put out the deprecation notice. I'll still maintain it, but it will be feature complete. It will just be in maintenance mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants