import type { Token } from '../types.js'; import type { ContextStash, TokenHandler, } from '../MarkdownSerializer.js'; export function getFootnoteTokensHandlers(): Record< string, Array > { return { 'footnote_block_open': [ (token: Token, ctx: ContextStash) => { }, ], 'footnote_block_close': [ (token: Token, ctx: ContextStash) => { }, ], 'footnote_open': [ (token: Token, ctx: ContextStash) => { if (token.meta.label) { ctx.current.log(`[^${token.meta.label}]: `, token); } else { ctx.current.log(`[^footnote_${token.meta.id}]: `, token); } ctx.stash('getFootnoteTokensHandlers.footnote_open'); ctx.current.footnoteCnt++; ctx.current.itemRow = 0; }, ], 'footnote_close': [ (token: Token, ctx: ContextStash) => { ctx.unstash('getFootnoteTokensHandlers.footnote_close'); }, ], 'footnote_anchor': [ (token: Token, ctx: ContextStash) => { }, ], }; }