lix-website/themes/lix/assets/bootstrap/node_modules/micromark/lib/parse.mjs
2024-04-26 22:49:34 -06:00

35 lines
1 KiB
JavaScript

export default parse
import * as initializeContent from './initialize/content.mjs'
import * as initializeDocument from './initialize/document.mjs'
import * as initializeFlow from './initialize/flow.mjs'
import * as initializeText from './initialize/text.mjs'
import combineExtensions from './util/combine-extensions.mjs'
import createTokenizer from './util/create-tokenizer.mjs'
import miniflat from './util/miniflat.mjs'
import * as constructs from './constructs.mjs'
function parse(options) {
var settings = options || {}
var parser = {
defined: [],
constructs: combineExtensions(
[constructs].concat(miniflat(settings.extensions))
),
content: create(initializeContent),
document: create(initializeDocument),
flow: create(initializeFlow),
string: create(initializeText.string),
text: create(initializeText.text)
}
return parser
function create(initializer) {
return creator
function creator(from) {
return createTokenizer(parser, initializer, from)
}
}
}