@yozora/tokenizer-inline-math v2.3.12
@yozora/tokenizer-inline-math produce InlineMath type nodes. See documentation for details.
Install
npm
npm install --save @yozora/tokenizer-inline-mathyarn
yarn add @yozora/tokenizer-inline-math
Usage
@yozora/tokenizer-inline-math has been integrated into @yozora/parser, so you can use
YozoraParser directly.
Basic Usage
@yozora/tokenizer-inline-math 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 InlineMathTokenizer from '@yozora/tokenizer-inline-math'
const parser = new DefaultParser()
.useFallbackTokenizer(new ParagraphTokenizer())
.useFallbackTokenizer(new TextTokenizer())
.useTokenizer(new InlineMathTokenizer())
// parse source markdown content
parser.parse("`$x^2 + y^2 = z^2, x < 0$`")Use within @yozora/parser
import YozoraParser from '@yozora/parser'
const parser = new YozoraParser()
// parse source markdown content
parser.parse("`$x^2 + y^2 = z^2, x < 0$`")Use with @yozora/parser-gfm
import GfmParser from '@yozora/parser-gfm'
import InlineMathTokenizer from '@yozora/tokenizer-inline-math'
const parser = new GfmParser()
parser.useTokenizer(new InlineMathTokenizer())
// parse source markdown content
parser.parse("`$x^2 + y^2 = z^2, x < 0$`")Use within @yozora/parser-gfm-ex
import GfmExParser from '@yozora/parser-gfm-ex'
import InlineMathTokenizer from '@yozora/tokenizer-inline-math'
const parser = new GfmExParser()
parser.useTokenizer(new InlineMathTokenizer())
// parse source markdown content
parser.parse("`$x^2 + y^2 = z^2, x < 0$`")Options
| Name | Type | Required | Default |
|---|---|---|---|
name | string | false | "@yozora/tokenizer-inline-math" |
priority | number | false | TokenizerPriority.ATOMIC |
delimiterGroup | string | false | <this.name> |
backtickRequired | boolean | false | true |
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 thematch-blockstage, a high-priority tokenizer can interrupt the matching process of a low-priority tokenizer.Exception: Delimiters of type
fullare always processed before other type delimiters.delimiterGroup: Delimiter group identity. All delimiters with a samedelimiterGroupcan be cleaned up at the same time in a certaininvalidateOldDelimiters()call.Designed to handle situations such as link and link-reference both cannot contain other links.
backtickRequired: Whether if the backtick mark wrapping necessary.
Related
8 months ago
9 months ago
10 months ago
11 months ago
11 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago