mirror of
https://github.com/penxio/penx.git
synced 2026-01-14 07:57:56 -05:00
12 lines
312 B
TypeScript
12 lines
312 B
TypeScript
import { MdastNode, OptionType } from './ast-types'
|
|
import transform from './deserialize'
|
|
|
|
export default function plugin(opts?: OptionType) {
|
|
const compiler = (node: { children: Array<MdastNode> }) => {
|
|
return node.children.map((c) => transform(c, opts))
|
|
}
|
|
|
|
// @ts-ignore
|
|
this.Compiler = compiler
|
|
}
|