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

Question: how to detect when yaml contains comments #305

Closed
markwongsk opened this issue Oct 31, 2016 · 1 comment
Closed

Question: how to detect when yaml contains comments #305

markwongsk opened this issue Oct 31, 2016 · 1 comment

Comments

@markwongsk
Copy link

In my use case, users write yaml with comments and expect them to be preserved. This might be out of the project's scope, but is there a way I can warn the user? I'm looking at https://github.com/nodeca/js-yaml/blob/master/lib/js-yaml/loader.js#L343-L347 and would want a throwWarning or throwError for my use case.

@dervus
Copy link
Collaborator

dervus commented Nov 1, 2016

For that normally you should you use YAML implementation that can produce AST. Like libyaml or JS-YAML 1.x (unsupported).

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

No branches or pull requests

2 participants