We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Considering this yml input
environment: ### SESSION START ### A: "true" B: "true" ### SESSION END ###
if the document is parsed and then printed out the result is not the same, but the comment goes on the same line as 'B'.
const file = fs.readFileSync('./test/input/config.yml', 'utf8') const doc = YAML.parseDocument(file) doc.toString()
output
Expected behaviour I would like to preserve the positioning of the comment. There is a way to achieve it?
Versions:
The text was updated successfully, but these errors were encountered:
Are you sure that this is happening with the example that you posted above? I'm not able to replicate this behaviour:
const doc = YAML.parseDocument(`environment: ### SESSION START ### A: "true" B: "true" ### SESSION END ### `) doc.toString() > 'environment:\n' + ' ### SESSION START ###\n' + ' A: "true"\n' + ' B: "true"\n' + ' ### SESSION END ###\n'
I don't doubt that end-comment placement is problematic, so this may well be a dupe of #244.
Sorry, something went wrong.
Oh yeah, my bad I haven't reported an important detail apparently: The empty line at the end of the input.
const doc = YAML.parseDocument(`environment: ### SESSION START ### A: "true" B: "true" ### SESSION END ### `); doc.toString() > 'environment:\n' + ' ### SESSION START ###\n' + ' A: "true"\n' + ' B: "true" ### SESSION END ###\n'
Here the project to reproduce it: https://stackblitz.com/edit/test-yml
This use case is useful for me when there are ymls more complex and space and line comment can be used to gain more clarity.
environment: ### SESSION START ### A: "true" B: "true" ### SESSION END ### ### ANOTHER SESSION START ### C: "true" D: "true" ### ANOTHER SESSION END ###
like this example above.
test: Add example from #277
a424eec
Successfully merging a pull request may close this issue.
Considering this yml input
if the document is parsed and then printed out the result is not the same, but the comment goes on the same line as 'B'.
output
Expected behaviour
I would like to preserve the positioning of the comment. There is a way to achieve it?
Versions:
The text was updated successfully, but these errors were encountered: