You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sounds wild, I know. And it's a bit of an edge case.
But if you have a script tag in an element definition, and then in that script tag you have a string that contains an open or close "<script>", the parser gets eager to start extracting scripts.
Here's a sample <my-element> that will blow up in the browser -- server render works, or at least doesn't throw
exportdefaultfunction({ html }){returnhtml`<h1class="text4 font-mono">my-element</h1><script>console.log('start.')// this string will trip up the parserconstsomeHTML2= '<script>window.$$ = "$$";</script>' console.log('done.')</script> `}
and here's a screenshot of what is rendered
The text was updated successfully, but these errors were encountered:
And if you're wondering how I got here: I have blobs of text (blog posts) that often contain code-like content but are not actually code to be executed.
These blobs are sometimes loaded into an editor in the browser, so I hydrate that content via a top-level script tag like
Sounds wild, I know. And it's a bit of an edge case.
But if you have a script tag in an element definition, and then in that script tag you have a string that contains an open or close "<script>", the parser gets eager to start extracting scripts.
Here's a sample
<my-element>
that will blow up in the browser -- server render works, or at least doesn't throwand here's a screenshot of what is rendered
The text was updated successfully, but these errors were encountered: