codesandbox-client icon indicating copy to clipboard operation
codesandbox-client copied to clipboard

Broken HTML in embed mode

Open cherniavskii opened this issue 1 year ago • 0 comments

🐛 bug report

Preflight Checklist

  • [x] I have read the Contributing Guidelines for this project.
  • [x] I agree to follow the Code of Conduct that this project adheres to.
  • [x] I have searched the issue tracker for an issue that matches the one I want to file, without success.

Description of the problem

In embed mode, the HTML is broken if one of the files contains $` (dollar sign followed by a backtick). This seems to be breaking the HTML templating engine that is used in embed mode. The issue is only reproducible in embed.

How has this issue affected you? What are you trying to accomplish?

At MUI, we have a link to codesandbox for every demo in our docs using the define API. Recently, we started using the embed mode because it's faster and it opens the file specified in the params (see https://github.com/mui/material-ui/pull/43618)

To Reproduce

Go to https://codesandbox.io/embed/infallible-lederberg-st3lrx?file=%2Findex.html

The text node visible in the side panel:

In the source, you can see that it breaks where the $` symbols should be:

Link to sandbox: https://codesandbox.io/p/sandbox/infallible-lederberg-st3lrx?file=%2Findex.html

Workarounds

Putting a space between $ and ` seems to be working: https://codesandbox.io/embed/blazing-platform-k5sk46?file=%2Findex.html

Your Environment

N/A

cherniavskii avatar Sep 11 '24 18:09 cherniavskii