Skip to main content
Version: 2.x.x

@yozora/tokenizer-footnote-definition

Npm VersionNpm DownloadNpm LicenseModule formats: cjs, esmNode.js VersionTested with JestCode Style: prettier

note

Installโ€‹

npm install --save @yozora/tokenizer-footnote-definition

Usageโ€‹

tip

@yozora/tokenizer-footnote-definition has been integrated into @yozora/parser, so you can use YozoraParser directly.

import YozoraParser from '@yozora/parser'

const parser = new YozoraParser()

// parse source markdown content
parser.parse(`
Here is a footnote reference,[^1]
another,[^long note],

[^big footnote]: Here's one with multiple paragraphs and code.

Indent paragraphs to include them in the footnote.

\`\`\`
Fenced coding
\`\`\`

## heading

Add as many paragraphs as you like.
`)

Optionsโ€‹

NameTypeRequiredDefault
namestringfalse"@yozora/tokenizer-footnote-definition"
prioritynumberfalseTokenizerPriority.ATOMIC
  • name: The unique name of the tokenizer, used to bind the token it generates, to determine the tokenizer that should be called in each life cycle of the token in the entire matching / parsing phase.

  • priority: Priority of the tokenizer, determine the order of processing, high priority priority execution. interruptable. In addition, in the match-block stage, a high-priority tokenizer can interrupt the matching process of a low-priority tokenizer.

Typesโ€‹

@yozora/tokenizer-footnote-definition produce FootnoteDefinition type nodes. See @yozora/ast for full base types.

import type { Association, Parent } from '@yozora/ast'

export const FootnoteDefinitionType = 'footnoteDefinition'
export type FootnoteDefinitionType = typeof FootnoteDefinitionType

/**
* FootnoteDefinition represents content relating to the document that is
* outside its flow.
* @see https://github.com/syntax-tree/mdast#footnotedefinition
*/
export interface FootnoteDefinition
extends Parent<FootnoteDefinitionType>, Association {}

Live Examplesโ€‹