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

fix: add closing tag to "script" tag #73

Merged
merged 2 commits into from
Apr 19, 2021

Conversation

owenvoke
Copy link
Contributor

@owenvoke owenvoke commented Apr 12, 2021

I had a weird issue where in my production app, the JavaScript wasn't working. Spent ages debugging and apparently <script> elements should always have a closing tag, rather than auto-closing. And applying this change seemed to resolve the issue.

I'm not sure if this is just a regression with Firefox developer edition, although it also seemed to fail in Chrome (I'm running on macOS Big Sur), but I'd be interested to know if anyone else experienced this issue.

For reference, I am using HTML 5 DocType (<!DOCTYPE html>), so self-closing tags should in theory be fine. Although according to MDN, both <script> and </script> should always be included. It looks like this is how it was done in v2.x

return "<script src='{$href}' {$integrity} {$attributes}></script>";

@Elhebert Elhebert merged commit 9f872fb into Elhebert:master Apr 19, 2021
@owenvoke owenvoke deleted the bugfix/script-closure branch April 19, 2021 07:06
@owenvoke
Copy link
Contributor Author

Thanks! Just a heads up @Elhebert, this should be a v3.0.1 tag rather than v2.5.1. This only affects v3.x

@Elhebert
Copy link
Owner

🤦‍♂️ Went too fast when creating the release. The last release was a 2.5.0. Will fix that :D

@Elhebert
Copy link
Owner

Done 👌

@owenvoke
Copy link
Contributor Author

Cheers!

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