Templates: Always parse blocks from content #9448
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 #9433
This pull request seeks to resolve an issue where no demo content is shown on the demo screen. It does without sacrificing the original intent of #9288, which had been the cause for the regression described by #9433.
Post content is always parsed, regardless of whether a template is assigned or the post is new or being edited. This allows the initial demo content to be parsed as blocks.
If a template exists and the post is new, only then is the template applied by synchronizing. In most cases, the initial content would have been empty and the blocks an empty array (as had existed in previous logic), but this also accounts for potential divergences between content of the new post and the template.
Testing instructions:
Repeat steps to reproduce from #9433, verifying demo content is shown.
Repeat testing instructions from #9288.
Ensure end-to-end tests pass: