site/node_modules/micromark-extension-math/lib/syntax.js
2024-10-14 08:09:33 +02:00

28 lines
627 B
JavaScript

/**
* @typedef {import('micromark-util-types').Extension} Extension
* @typedef {import('./math-text.js').Options} Options
*/
import {mathFlow} from './math-flow.js'
import {mathText} from './math-text.js'
/**
* Create an extension for `micromark` to enable math syntax.
*
* @param {Options | null | undefined} [options={}]
* Configuration (default: `{}`).
* @returns {Extension}
* Extension for `micromark` that can be passed in `extensions`, to
* enable math syntax.
*/
export function math(options) {
return {
flow: {
[36]: mathFlow
},
text: {
[36]: mathText(options)
}
}
}