prevent docs HTML sanitizer from removing youtube embeds #11045
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 microsoft/pxt-arcade#7200
despite what the linked issue says, this was not mac specific. it also reproes on windows
we configure our docs renderer to take images where the href starts with
youtube:and replace them with iframes that contain the youtube embedded player. the recent marked changes, however, were causing our dom sanitizer to then remove those iframe embeds from the generated html (which makes sense, it probably should do that). this PR fixes that by changing our markdown renderer to just leave a div in the rendered HTML, and then hydrating the youtube video embed after the fact. this also fixes it for docs pages, which currently don't handle theyoutube:syntax correctly on live