diff --git a/src/utils.js b/src/utils.js
index 572dd0bc..7958bed2 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -428,6 +428,22 @@ function getAttributeValue(attributes, name) {
return attributes[lowercasedAttributes[name.toLowerCase()]];
}
+function scriptFilter(tag, attribute, attributes) {
+ if (attributes.type) {
+ const type = getAttributeValue(attributes, 'type').trim().toLowerCase();
+
+ if (
+ type !== 'module' &&
+ type !== 'text/javascript' &&
+ type !== 'application/javascript'
+ ) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
const defaultAttributes = [
{
tag: 'audio',
@@ -483,21 +499,20 @@ const defaultAttributes = [
tag: 'script',
attribute: 'src',
type: 'src',
- filter: (tag, attribute, attributes) => {
- if (attributes.type) {
- const type = getAttributeValue(attributes, 'type').trim().toLowerCase();
-
- if (
- type !== 'module' &&
- type !== 'text/javascript' &&
- type !== 'application/javascript'
- ) {
- return false;
- }
- }
-
- return true;
- },
+ filter: scriptFilter,
+ },
+ // Using href with \\\\n\\\\n\\\\n\\\\n
Foo
\\\\n\\\\n\\\\nBAR
\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n