Comparing version 0.3.3 to 0.3.4
@@ -74,3 +74,3 @@ #!/usr/bin/env node | ||
const contents = await input.getContents(); | ||
const [scriptBlock, attrs = "", script] = contents.match(/<script(\s[^>\s]*)*>([\S\s.]*?)<\/script>/) || []; | ||
const [scriptBlock, attrs = "", _lastAttr, script] = contents.match(/<script((\s[^>\s]*)*)>([\S\s.]*?)<\/script>/) || []; | ||
if (!scriptBlock || !script) { | ||
@@ -91,6 +91,7 @@ return; | ||
} | ||
const newAttrs = attrs.replace(new RegExp(`\\s?lang="${lang}"`), ""); | ||
return [ | ||
{ | ||
path: input.path, | ||
contents: contents.replace(scriptBlock, `<script> | ||
contents: contents.replace(scriptBlock, `<script${newAttrs}> | ||
${scriptFile.contents}<\/script>`) | ||
@@ -97,0 +98,0 @@ }, |
@@ -72,3 +72,3 @@ 'use strict'; | ||
const contents = await input.getContents(); | ||
const [scriptBlock, attrs = "", script] = contents.match(/<script(\s[^>\s]*)*>([\S\s.]*?)<\/script>/) || []; | ||
const [scriptBlock, attrs = "", _lastAttr, script] = contents.match(/<script((\s[^>\s]*)*)>([\S\s.]*?)<\/script>/) || []; | ||
if (!scriptBlock || !script) { | ||
@@ -89,6 +89,7 @@ return; | ||
} | ||
const newAttrs = attrs.replace(new RegExp(`\\s?lang="${lang}"`), ""); | ||
return [ | ||
{ | ||
path: input.path, | ||
contents: contents.replace(scriptBlock, `<script> | ||
contents: contents.replace(scriptBlock, `<script${newAttrs}> | ||
${scriptFile.contents}<\/script>`) | ||
@@ -95,0 +96,0 @@ }, |
{ | ||
"name": "mkdist", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"description": "Lightweight file-to-file transformer", | ||
@@ -5,0 +5,0 @@ "repository": "unjs/mkdist", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
479
20016
6