13 lines
233 B
JavaScript
13 lines
233 B
JavaScript
export default async function (doc, rootNode) {
|
|
const node = {
|
|
type: rootNode.head,
|
|
class: '',
|
|
}
|
|
|
|
for await (const child of rootNode.children()) {
|
|
if (child.is('class')) node.class = child.tail
|
|
}
|
|
|
|
return node
|
|
}
|