Fix Markdown rendering inside templates. #1219
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.
Description
Fixes a bug where a Markdown component inside a Deck template would break Spectacle. The previous implementation of Markdown always creates a Notes node tree, even with undefined children if there are no notes, which cannot exist on a template as it's not a slide. This verifies there is note content before building the Notes node tree.
Type of Change
Please delete options that are not relevant (including this descriptive text).
How Has This Been Tested?
Add a
<Markdown />
component with text content to a Deck template before this change and see Spectacle break and fail to render. Check it after and see it correctly render the Markdown component.Example below showing a Markdown component on the template and notes inside a Markdown slide verifying no regressions introduced.