Repository navigation
fix(app): normalize the head tag before creating the final sandbox - #107
Open
asasemahmed wants to merge 1 commit into
Open
asasemahmed wants to merge 1 commit into
asasemahmed wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
websandbox requires the literal string
<head>inframeContentand throwsiFrame content must have "<head>" tagotherwise.ensureHead()accepts any/<head[\s>]/i, so generated documents with<head lang="en">or<HEAD>pass through unchanged. The final sandbox then fails to load. The error is logged as "Failed to load sandbox module", and the preview has already been torn down, so the user is left with an empty box. Full documents with a head are expected here, because the tool description asks for CDN scripts in<head>.ensureHead()now:<head>,<head>(attributes on head have no effect),buildFinalFrameContent()then inserts the head content right after that literal tag, which also means a<header>element can never be taken for the head.Tests: the new
frame-content.test.tscovers<head lang="en">,<HEAD>and a<header>-only body. The renderer tests mock websandbox, which is why this wasn't caught.