codesandbox / sandpack

A component toolkit for creating live-running code editing experiences, using the power of CodeSandbox.
https://sandpack.codesandbox.io
Apache License 2.0
4.67k stars 329 forks source link

Body attributes being stripped #924

Closed sufigaffar closed 1 year ago

sufigaffar commented 1 year ago

Bug report

Packages affected

Description of the problem

Seemingly, for non-static Sandpack templates, attributes from the body tag are getting stripped. This includes inline styles, which is causing issues for us in some situations.

What were you doing when the problem occurred?

Had been comparing the rendered output between a code editor built with Sandpack and CodeMirror, and noticed there were some discrepancies.

What steps can we take to reproduce the problem?

Using non-static Sandpack template, add a body tag with an inline style and see that it gets stripped from the rendered output. Then try with the static template, and see it works as expected.

Link to sandbox: link (optional)

Your Environment

Software Name/Version
Sandpack-client version 1.20.9
Sandpack-react version 1.20.9
Browser Arc
Operating System mac OS
danilowoz commented 1 year ago

It's a hard limitation for runtime sandboxes, see more on https://github.com/codesandbox/sandpack/issues/32