Allow layout blocks within Doc transclusion #4458
Merged
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.
Fixes #4384
Previously, code like this would not parse:
Now it parses fine. The fix was to re-enable layout within a transclusion, and to have
}}
pop layout up to the enclosing{{
. Prior to this change, layout was incorrectly being entirely disabled within a doc block, even within a nested transclusion which can contain arbitrary Unison code that uses layout.The diff is actually very small, just one function (see self-review), but I had to move some helper functions out of a where clause to make them available for this change, so the actual diff looks bigger.
Interesting/controversial decisions
Nothing.
Test coverage
Added regression tests, including some weird examples I could think of, and existing transcripts cover the doc syntax. I feel pretty confident this can only improve parsing and round trip issues, but after merging to trunk, I'd recommend dogfooding it for a couple days just to make sure there aren't any regressions in weird corner cases I haven't thought of.
cc @stew @runarorama @ceedubs who I know have been affected by this.