18 lines
339 B
JavaScript
18 lines
339 B
JavaScript
import { contentAsText } from '../helpers.js'
|
|
|
|
export default async function (doc, rootLevel) {
|
|
const { next, line, match, tail, level, head } = doc
|
|
|
|
const node = {
|
|
type: head(),
|
|
variant: tail() || 'neutral',
|
|
class: ''
|
|
}
|
|
|
|
while (await next(rootLevel)) {
|
|
if (match('class')) node.class = tail()
|
|
}
|
|
|
|
return node
|
|
}
|