We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 20e5eec commit 7b16bd1Copy full SHA for 7b16bd1
CWE-80/main.js
@@ -1,7 +1,10 @@
1
const main = (html) => {
2
- const regex = /<script>.*<\/script>/gi
+ const scriptRegex = /<script\b[^>]*>([\s\S]*?)<\/script>/gi
3
+ let match
4
- if (regex.test(html)) {
5
- document.body.innerHTML = html
+ while ((match = scriptRegex.exec(html)) !== null) {
6
+ html = html.replace(match[0], match[1])
7
}
8
+
9
+ return html
10
0 commit comments