Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't modify script nodes with text/html type #1924

Merged
merged 1 commit into from
Sep 22, 2018

Conversation

southpolesteve
Copy link
Contributor

Knockout.js uses <script type="text/html> for named templates. Currently, the type attribute is stripped by parcel. This change prevents that from happening.

Knockout.js uses <script type="text/html> for named templates. Currently, the type attribute is stripped by parcel. This change prevents that from happening.
@@ -64,7 +64,8 @@ const META = {
const SCRIPT_TYPES = {
'application/javascript': 'js',
'text/javascript': 'js',
'application/json': false
'application/json': false,
'text/html': false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should change it to a whitelist instead of a blacklist? Basically, just application/javascript and text/javascript, or if the type attribute is not specified. We could also enable typescript, coffeescript, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. In the case of no type attribute you would like to keep existing behavior and default to JS? Wondering if this will be a breaking change for existing users.

@bre7 bre7 mentioned this pull request Aug 26, 2018
6 tasks
@devongovett devongovett merged commit d2f5a05 into parcel-bundler:master Sep 22, 2018
devongovett pushed a commit that referenced this pull request Oct 15, 2018
Knockout.js uses <script type="text/html> for named templates. Currently, the type attribute is stripped by parcel. This change prevents that from happening.
devongovett pushed a commit that referenced this pull request Oct 15, 2018
Knockout.js uses <script type="text/html> for named templates. Currently, the type attribute is stripped by parcel. This change prevents that from happening.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants