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 }