boxwood 0.63.1 → 0.64.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.
- package/index.js +5 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -12,6 +12,7 @@ async function compile(path) {
|
|
|
12
12
|
const styles = []
|
|
13
13
|
const scripts = []
|
|
14
14
|
const walk = (node) => {
|
|
15
|
+
if (!node) { return }
|
|
15
16
|
if (node.name === 'head') {
|
|
16
17
|
nodes.head = node
|
|
17
18
|
}
|
|
@@ -35,7 +36,7 @@ async function compile(path) {
|
|
|
35
36
|
if (Array.isArray(node)) {
|
|
36
37
|
node.forEach(walk)
|
|
37
38
|
} else if (Array.isArray(node.children)) {
|
|
38
|
-
node.children.forEach(walk)
|
|
39
|
+
node.children.filter(Boolean).forEach(walk)
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
walk(tree)
|
|
@@ -129,7 +130,9 @@ const attributes = (options) => {
|
|
|
129
130
|
result.push(key)
|
|
130
131
|
} else {
|
|
131
132
|
const name = ALIASES[key] || key
|
|
132
|
-
|
|
133
|
+
const value = options[key]
|
|
134
|
+
const content = Array.isArray(value) ? classes(...value) : value
|
|
135
|
+
result.push(name + '=' + '"' + content + '"')
|
|
133
136
|
}
|
|
134
137
|
}
|
|
135
138
|
}
|