Add a failing test for a partial containing a block #573
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.
Here is a failing test for a partial containing a block. This is in response to @sunng87's request: #504 (comment).
For comparison, here is how handlebars.js handles this situation:
https://handlebarsjs.com/playground.html#format=1¤tExample=%7B%22template%22%3A%22%7B%7B%23*inline%20%5C%22thepartial%5C%22%7D%7D%5Cnpartial%20first%20line%5Cn%7B%7B%23if%20true%7D%7D%5Cn%20%20%20%20partial%20second%20line%5Cn%7B%7B%2Fif%7D%7D%5Cnpartial%20third%20line%5Cn%7B%7B%2Finline%7D%7D%5Cnbefore%20partial%5Cn%20%20%20%20%7B%7B%3E%20thepartial%7D%7D%5Cnafter%20partial%22%2C%22partials%22%3A%5B%5D%2C%22input%22%3A%22%7B%7D%22%2C%22output%22%3A%22before%20partial%5Cn%20%20%20%20partial%20first%20line%5Cn%20%20%20%20%20%20%20%20partial%20second%20line%5Cn%20%20%20%20partial%20third%20line%5Cnafter%20partial%22%2C%22preparationScript%22%3A%22%22%2C%22handlebarsVersion%22%3A%224.7.7%22%7D
It's also worth noting that the bug does not occur if the inline partial is defined with similar indentation but without using a block. It seems to really be an issue about blocks within partials. Some examples:
Indentation is processed correctly:
Indentation is not processed correctly:
Indentation is also not processed correctly: