Comments or strings containing </script> are not escaping the “<”
gblakeman opened this issue · 5 comments
Environment and package version
Webpack @ 5.73.0, HTML Webpack Plugin @ 5.5.0, HTML Inline Script Plugin @ 3.0.1
Reproduction link / code sample
A comment to test with:
/**
* Typing this makes it possible for IDEs like VS Code with the Svelte extension
* to provide intellisense and to use the component like this in a Svelte file
* with TypeScript:
* ```svelte
* <script lang="ts">
* import { MyComponent } from "component-library";
* </script>
* <MyComponent foo={'bar'} />
* ```
*/
Steps to reproduce
I am unsure if this is a HTML Webpack Plugin issue or a HTML Inline Script Plugin issue, but I did not have the issue using HTML Webpack Plugin 4.x and a different inlining plugin (HTML Inline Source Plugin).
What is expected?
Comments or strings that contain </script>
will have the <
escaped to \x3C
.
What is actually happening?
Comments or strings that contain </script>
are not escaped and appear inline as </script>
causing a parse error in browsers.
It does look like the previous plugin I was using with Webpack 4.x was handling this scenario for me. Maybe something to add to this one?
@gblakeman Agree this should be supported by this plugin. I will try to work on the feature and make a release within this week.
@gblakeman This feature has just been released in version 3.1.0. Let me know if it works.