15 lines
246 B
JavaScript
15 lines
246 B
JavaScript
export default async function (doc, rootLevel) {
|
|
const { next, head, tail, match } = doc
|
|
|
|
const node = {
|
|
type: head(),
|
|
class: '',
|
|
}
|
|
|
|
while (await next(rootLevel)) {
|
|
if (match('class')) node.class = tail()
|
|
}
|
|
|
|
return node
|
|
}
|