@yozora/tokenizer-footnote
@yozora/tokenizer-footnote
npm i @yozora/tokenizer-footnote
@yozora/tokenizer-footnote

@yozora/tokenizer-footnote

A customizable markup parser for resolving markdown-like syntax strings into AST and vice versa.

by yozorajs

2.0.5 (see all)License:MITTypeScript:Built-In
npm i @yozora/tokenizer-footnote
Readme

@yozora/tokenizer-footnote


@yozora/tokenizer-footnote produce Footnote type nodes. See documentation for details.

Install

  • npm

    npm install --save @yozora/tokenizer-footnote
    
  • yarn

    yarn add @yozora/tokenizer-footnote
    

Usage

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

Basic Usage

@yozora/tokenizer-footnote cannot be used alone, it needs to be registered in YastParser as a plugin-in before it can be used.

import { DefaultParser } from '@yozora/core-parser'
import ParagraphTokenizer from '@yozora/tokenizer-paragraph'
import TextTokenizer from '@yozora/tokenizer-text'
import FootnoteTokenizer from '@yozora/tokenizer-footnote'

const parser = new DefaultParser()
  .useFallbackTokenizer(new ParagraphTokenizer())
  .useFallbackTokenizer(new TextTokenizer())
  .useTokenizer(new FootnoteTokenizer())

// parse source markdown content
parser.parse(`
^[inline footnote]

^[footnote with *emphasis* and $x^2+y^2$ and `inline code`]
`)

Use within @yozora/parser

import YozoraParser from '@yozora/parser'

const parser = new YozoraParser()

// parse source markdown content
parser.parse(`
^[inline footnote]

^[footnote with *emphasis* and $x^2+y^2$ and `inline code`]
`)

Use with @yozora/parser-gfm

import GfmParser from '@yozora/parser-gfm'
import FootnoteTokenizer from '@yozora/tokenizer-footnote'

const parser = new GfmParser()
parser.useTokenizer(new FootnoteTokenizer())

// parse source markdown content
parser.parse(`
^[inline footnote]

^[footnote with *emphasis* and $x^2+y^2$ and `inline code`]
`)

Use within @yozora/parser-gfm-ex

import GfmExParser from '@yozora/parser-gfm-ex'
import FootnoteTokenizer from '@yozora/tokenizer-footnote'

const parser = new GfmExParser()
parser.useTokenizer(new FootnoteTokenizer())

// parse source markdown content
parser.parse(`
^[inline footnote]

^[footnote with *emphasis* and $x^2+y^2$ and `inline code`]
`)

Options

NameTypeRequiredDefault
namestringfalse"@yozora/tokenizer-footnote"
prioritynumberfalseTokenizerPriority.LINKS
  • 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.

No alternatives found
No tutorials found
Add a tutorial
No dependencies found

Rate & Review

100
No reviews found
Be the first to rate