Ensure image values are parsed from the same line as the image key #567
+36
−23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The previous regular expression would search for the expected images declaration and then parse both horizontal and vertical space for the value of that key. This function intended on grabbing a value of a given yaml key, but by traversing vertical space, would grab a completely separate key and value of an object.
This replacement regular expression more accurately captures the intended behavior of evaluating a given line of a template and searching for the an image value. This is done by enabling multiline mode and searching strictly horizontal space in the line for the value of the image.
NOTE: A test case was added, and gofumpt took some issue with the resulting formatting, which is why some things have changed in the test that have nothing to do with the newly added test.