(code)
| 91 | } |
| 92 | |
| 93 | function stripHTML(code) { |
| 94 | let included = "", script = "" |
| 95 | code = code.replace(/<script\b[^>]*?(?:\bsrc\s*=\s*('[^']+'|"[^"]+"|[^\s>]+)[^>]*)?>([\s\S]*?)<\/script>/, function(m, src, content) { |
| 96 | if (!src) { |
| 97 | script += content |
| 98 | } else if (doRun) { |
| 99 | if (/["']/.test(src.charAt(0))) src = src.slice(1, src.length - 1) |
| 100 | included += fs.readFileSync("html/" + src, "utf8") |
| 101 | } |
| 102 | return "" |
| 103 | }) |
| 104 | return {html: code, included: included, javascript: script} |
| 105 | } |
| 106 | |
| 107 | function represent(val) { |
| 108 | if (typeof val == "boolean") return String(val) |
no test coverage detected