-
-
Notifications
You must be signed in to change notification settings - Fork 225
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
Escape "</script" when inlining strings #384
Conversation
@@ -112,6 +112,12 @@ module.exports = ({ types: t, traverse }) => { | |||
} | |||
} | |||
|
|||
// https://github.com/babel/babili/issues/382 | |||
if (typeof res.value === "string" && | |||
res.value.indexOf("</script") > -1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use includes
instead of indexof
since we are already targeting node 4?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
includes
was introduced in node 6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah...I know that..But we are transpiling the code to node 4.. So it shouldnt be a problem
should this also account for the |
We could just use |
Fixes #382