Skip to main content
Version: 3.x.x ๐Ÿšง

@yozora/tokenizer-footnote-reference

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

note

Installโ€‹

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

Usageโ€‹

tip

@yozora/tokenizer-footnote-reference 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-reference"
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.

    Exception: Delimiters of type full are always processed before other type delimiters.

Typesโ€‹

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

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

export const FootnoteReferenceType = 'footnoteReference'
export type FootnoteReferenceType = typeof FootnoteReferenceType

/**
* FootnoteReference represents a marker through association.
*
* Similar to imageReference and linkReference, the difference is that it has
* only 'collapsed' reference type instead of 'full' and 'shortcut'
* @see https://github.com/syntax-tree/mdast#footnotereference
* @see https://github.com/syntax-tree/mdast#imagereference
* @see https://github.com/syntax-tree/mdast#linkreference
*/
export interface FootnoteReference
extends Node<FootnoteReferenceType>, Association {}

Live Examplesโ€‹