@yozora/tokenizer-inline-math 2.0.5 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- import { IPartialYastInlineToken, ITokenizer, IBaseInlineTokenizerProps, IYastTokenDelimiter, IMatchInlineHookCreator, IParseInlineHookCreator, BaseInlineTokenizer, IInlineTokenizer } from '@yozora/core-tokenizer';
1
+ import { IPartialInlineToken, ITokenizer, IBaseInlineTokenizerProps, ITokenDelimiter, IMatchInlineHookCreator, IParseInlineHookCreator, BaseInlineTokenizer, IInlineTokenizer } from '@yozora/core-tokenizer';
2
2
  import { InlineMathType, InlineMath } from '@yozora/ast';
3
3
 
4
4
  type T = InlineMathType;
5
5
  type INode = InlineMath;
6
6
  declare const uniqueName = "@yozora/tokenizer-inline-math";
7
- interface IToken extends IPartialYastInlineToken<T> {
7
+ interface IToken extends IPartialInlineToken<T> {
8
8
  /**
9
9
  * Thickness of the InlineMathDelimiter
10
10
  */
@@ -13,7 +13,7 @@ interface IToken extends IPartialYastInlineToken<T> {
13
13
  /**
14
14
  * IDelimiter of InlineMathToken.
15
15
  */
16
- interface IDelimiter extends IYastTokenDelimiter {
16
+ interface IDelimiter extends ITokenDelimiter {
17
17
  type: 'full';
18
18
  /**
19
19
  * Thickness of the InlineMathDelimiter
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yozora/tokenizer-inline-math",
3
- "version": "2.0.5",
3
+ "version": "2.1.1",
4
4
  "description": "Tokenizer for processing inline math (formulas)",
5
5
  "author": {
6
6
  "name": "guanghechen",
@@ -49,12 +49,12 @@
49
49
  "test": "cross-env TS_NODE_FILES=true NODE_OPTIONS=--experimental-vm-modules jest --config ../../jest.config.mjs --rootDir ."
50
50
  },
51
51
  "dependencies": {
52
- "@yozora/ast": "^2.0.5",
53
- "@yozora/character": "^2.0.5",
54
- "@yozora/core-tokenizer": "^2.0.5"
52
+ "@yozora/ast": "^2.1.1",
53
+ "@yozora/character": "^2.1.1",
54
+ "@yozora/core-tokenizer": "^2.1.1"
55
55
  },
56
56
  "devDependencies": {
57
- "@yozora/tokenizer-inline-code": "^2.0.5"
57
+ "@yozora/tokenizer-inline-code": "^2.1.1"
58
58
  },
59
- "gitHead": "7ba3bab49fe65cf2f57082c0503af73da9356cf0"
59
+ "gitHead": "257a36d8dc079d4ac226405c155b238e7099bcea"
60
60
  }
package/src/match.ts CHANGED
@@ -5,7 +5,7 @@ import type {
5
5
  IMatchInlineHookCreator,
6
6
  IResultOfFindDelimiters,
7
7
  IResultOfProcessSingleDelimiter,
8
- IYastTokenDelimiter,
8
+ ITokenDelimiter,
9
9
  } from '@yozora/core-tokenizer'
10
10
  import { eatOptionalCharacters } from '@yozora/core-tokenizer'
11
11
  import type { IDelimiter, IThis, IToken, T } from './types'
@@ -19,7 +19,7 @@ export const match: IMatchInlineHookCreator<T, IDelimiter, IToken, IThis> = func
19
19
  const blockStartIndex: number = api.getBlockStartIndex()
20
20
  const blockEndIndex: number = api.getBlockEndIndex()
21
21
 
22
- const potentialDelimiters: IYastTokenDelimiter[] = []
22
+ const potentialDelimiters: ITokenDelimiter[] = []
23
23
  for (let i = blockStartIndex; i < blockEndIndex; ++i) {
24
24
  const c = nodePoints[i].codePoint
25
25
  switch (c) {
@@ -56,7 +56,7 @@ export const match: IMatchInlineHookCreator<T, IDelimiter, IToken, IThis> = func
56
56
  break
57
57
  }
58
58
 
59
- const delimiter: IYastTokenDelimiter = {
59
+ const delimiter: ITokenDelimiter = {
60
60
  type: 'opener',
61
61
  startIndex: _startIndex,
62
62
  endIndex: i + 1,
@@ -88,7 +88,7 @@ export const match: IMatchInlineHookCreator<T, IDelimiter, IToken, IThis> = func
88
88
  // No backtick character found after dollar
89
89
  if (thickness <= 1) {
90
90
  if (backtickRequired) break
91
- const delimiter: IYastTokenDelimiter = {
91
+ const delimiter: ITokenDelimiter = {
92
92
  type: 'both',
93
93
  startIndex: _startIndex,
94
94
  endIndex: i,
@@ -97,7 +97,7 @@ export const match: IMatchInlineHookCreator<T, IDelimiter, IToken, IThis> = func
97
97
  break
98
98
  }
99
99
 
100
- const delimiter: IYastTokenDelimiter = {
100
+ const delimiter: ITokenDelimiter = {
101
101
  type: 'closer',
102
102
  startIndex: _startIndex,
103
103
  endIndex: i,
package/src/types.ts CHANGED
@@ -1,16 +1,16 @@
1
1
  import type { InlineMath, InlineMathType } from '@yozora/ast'
2
2
  import type {
3
3
  IBaseInlineTokenizerProps,
4
- IPartialYastInlineToken,
4
+ IPartialInlineToken,
5
+ ITokenDelimiter,
5
6
  ITokenizer,
6
- IYastTokenDelimiter,
7
7
  } from '@yozora/core-tokenizer'
8
8
 
9
9
  export type T = InlineMathType
10
10
  export type INode = InlineMath
11
11
  export const uniqueName = '@yozora/tokenizer-inline-math'
12
12
 
13
- export interface IToken extends IPartialYastInlineToken<T> {
13
+ export interface IToken extends IPartialInlineToken<T> {
14
14
  /**
15
15
  * Thickness of the InlineMathDelimiter
16
16
  */
@@ -20,7 +20,7 @@ export interface IToken extends IPartialYastInlineToken<T> {
20
20
  /**
21
21
  * IDelimiter of InlineMathToken.
22
22
  */
23
- export interface IDelimiter extends IYastTokenDelimiter {
23
+ export interface IDelimiter extends ITokenDelimiter {
24
24
  type: 'full'
25
25
  /**
26
26
  * Thickness of the InlineMathDelimiter