boxwood 0.73.0 → 0.74.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +11 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -31,10 +31,18 @@ async function compile(path) {
31
31
  }
32
32
  if (node.name === "script") {
33
33
  const js = node.children
34
- if (!scripts.includes(js)) {
35
- scripts.push(js)
34
+ if (
35
+ node.attributes &&
36
+ (node.attributes.type === "application/json" ||
37
+ node.attributes.type === "application/ld+json")
38
+ ) {
39
+ node.ignore = false
40
+ } else {
41
+ if (js && !scripts.includes(js)) {
42
+ scripts.push(js)
43
+ }
44
+ node.ignore = true
36
45
  }
37
- node.ignore = true
38
46
  }
39
47
  if (Array.isArray(node)) {
40
48
  node.forEach(walk)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "boxwood",
3
- "version": "0.73.0",
3
+ "version": "0.74.0",
4
4
  "description": "Compile HTML templates into JS",
5
5
  "main": "index.js",
6
6
  "scripts": {