MCPcopy Create free account
hub / github.com/KaTeX/KaTeX / defineFunctionBuilders

Function defineFunctionBuilders

src/defineFunction.ts:197–210  ·  view source on GitHub ↗
({
    type, htmlBuilder, mathmlBuilder,
}: {
    type: NODETYPE;
    htmlBuilder?: HtmlBuilder<NODETYPE>;
    mathmlBuilder: MathMLBuilder<NODETYPE>;
})

Source from the content-addressed store, hash-verified

195 * stand-alone handler provided to `defineFunction`).
196 */
197export function defineFunctionBuilders<NODETYPE extends NodeType>({
198 type, htmlBuilder, mathmlBuilder,
199}: {
200 type: NODETYPE;
201 htmlBuilder?: HtmlBuilder<NODETYPE>;
202 mathmlBuilder: MathMLBuilder<NODETYPE>;
203}) {
204 if (htmlBuilder) {
205 _htmlGroupBuilders[type] = htmlBuilder;
206 }
207 if (mathmlBuilder) {
208 _mathmlGroupBuilders[type] = mathmlBuilder;
209 }
210}
211
212export const normalizeArgument = function(arg: AnyParseNode): AnyParseNode {
213 return arg.type === "ordgroup" && arg.body.length === 1 ? arg.body[0] : arg;

Callers 6

symbolsSpacing.tsFile · 0.90
symbolsOrd.tsFile · 0.90
supsub.tsFile · 0.90
ordgroup.tsFile · 0.90
symbolsOp.tsFile · 0.90
tag.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected