-
Notifications
You must be signed in to change notification settings - Fork 115
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
render implicit yml multi doc file correctly #551
Conversation
implicit = true | ||
YAML.parse_stream(rendered_content, "<rendered> #{filename}") { |d| implicit = d.implicit } | ||
implicit = [] | ||
YAML.parse_stream(rendered_content, "<rendered> #{filename}") { |d| implicit << d.implicit } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to change anything related to this here as well or that doesn't matter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bug happens because we take all the resources we're provided and turn it into a single output stream. So its important to have separators between each doc in the final output even if the input doc is implicit. The code you linked is for erb rendering a single file (which can contain partials) but it's important that we render it as requested by the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also update the name of the fixture to no-doc-separator
?
78bb04a
to
fbc7bee
Compare
fbc7bee
to
5745ef9
Compare
What are you trying to accomplish with this PR?
Fix a bug where we fail to add
---
to an implicit document if there are multiple documents in the file.Fixes: #513
How is this accomplished?
Only test the implicitness of the first yaml doc in a file.
What could go wrong?
We start adding doc separators when we shouldn't and create empty docs.