@yozora/tokenizer-inline-math 2.3.8 → 2.3.10
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.
- package/CHANGELOG.md +23 -0
- package/README.md +42 -42
- package/lib/cjs/index.cjs +38 -19
- package/lib/esm/index.mjs +39 -20
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
## <small>2.3.10 (2025-01-09)</small>
|
|
7
|
+
|
|
8
|
+
* chore: fix nx dependencies ([d11d405](https://github.com/yozorajs/yozora/commit/d11d405))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# Change Log
|
|
15
|
+
|
|
16
|
+
All notable changes to this project will be documented in this file. See
|
|
17
|
+
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
18
|
+
|
|
19
|
+
## <small>2.3.9 (2024-12-05)</small>
|
|
20
|
+
|
|
21
|
+
- :bug: fix(inline-math): the delimiter could be adjacent to a punctuation character
|
|
22
|
+
([a6071be](https://github.com/yozorajs/yozora/commit/a6071be))
|
|
23
|
+
|
|
24
|
+
# Change Log
|
|
25
|
+
|
|
3
26
|
All notable changes to this project will be documented in this file. See
|
|
4
27
|
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
28
|
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<header>
|
|
4
4
|
<h1 align="center">
|
|
5
|
-
<a href="https://github.com/yozorajs/yozora/tree/v2.3.
|
|
5
|
+
<a href="https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/inline-math#readme">@yozora/tokenizer-inline-math</a>
|
|
6
6
|
</h1>
|
|
7
7
|
<div align="center">
|
|
8
8
|
<a href="https://www.npmjs.com/package/@yozora/tokenizer-inline-math">
|
|
@@ -181,80 +181,80 @@ parser.parse("`$x^2 + y^2 = z^2, x < 0$`")
|
|
|
181
181
|
|
|
182
182
|
[live-examples]: https://yozora.guanghechen.com/docs/package/tokenizer-inline-math#live-examples
|
|
183
183
|
[docpage]: https://yozora.guanghechen.com/docs/package/tokenizer-inline-math
|
|
184
|
-
[homepage]: https://github.com/yozorajs/yozora/tree/v2.3.
|
|
184
|
+
[homepage]: https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/inline-math#readme
|
|
185
185
|
[gfm-spec]: https://github.github.com/gfm
|
|
186
186
|
[mdast-homepage]: https://github.com/syntax-tree/mdast
|
|
187
|
-
[@yozora/ast]: https://github.com/yozorajs/yozora/tree/v2.3.
|
|
188
|
-
[@yozora/ast-util]: https://github.com/yozorajs/yozora/tree/v2.3.
|
|
189
|
-
[@yozora/character]: https://github.com/yozorajs/yozora/tree/v2.3.
|
|
187
|
+
[@yozora/ast]: https://github.com/yozorajs/yozora/tree/v2.3.10/packages/ast#readme
|
|
188
|
+
[@yozora/ast-util]: https://github.com/yozorajs/yozora/tree/v2.3.10/packages/ast-util#readme
|
|
189
|
+
[@yozora/character]: https://github.com/yozorajs/yozora/tree/v2.3.10/packages/character#readme
|
|
190
190
|
[@yozora/eslint-config]:
|
|
191
191
|
https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/eslint-config#readme
|
|
192
|
-
[@yozora/core-parser]: https://github.com/yozorajs/yozora/tree/v2.3.
|
|
192
|
+
[@yozora/core-parser]: https://github.com/yozorajs/yozora/tree/v2.3.10/packages/core-parser#readme
|
|
193
193
|
[@yozora/core-tokenizer]:
|
|
194
|
-
https://github.com/yozorajs/yozora/tree/v2.3.
|
|
195
|
-
[@yozora/invariant]: https://github.com/yozorajs/yozora/tree/v2.3.
|
|
194
|
+
https://github.com/yozorajs/yozora/tree/v2.3.10/packages/core-tokenizer#readme
|
|
195
|
+
[@yozora/invariant]: https://github.com/yozorajs/yozora/tree/v2.3.10/packages/invariant#readme
|
|
196
196
|
[@yozora/jest-for-tokenizer]:
|
|
197
197
|
https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/jest-for-tokenizer#readme
|
|
198
|
-
[@yozora/parser]: https://github.com/yozorajs/yozora/tree/v2.3.
|
|
199
|
-
[@yozora/parser-gfm]: https://github.com/yozorajs/yozora/tree/v2.3.
|
|
198
|
+
[@yozora/parser]: https://github.com/yozorajs/yozora/tree/v2.3.10/packages/parser#readme
|
|
199
|
+
[@yozora/parser-gfm]: https://github.com/yozorajs/yozora/tree/v2.3.10/packages/parser-gfm#readme
|
|
200
200
|
[@yozora/parser-gfm-ex]:
|
|
201
|
-
https://github.com/yozorajs/yozora/tree/v2.3.
|
|
201
|
+
https://github.com/yozorajs/yozora/tree/v2.3.10/packages/parser-gfm-ex#readme
|
|
202
202
|
[@yozora/template-tokenizer]:
|
|
203
203
|
https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/template-tokenizer#readme
|
|
204
204
|
[@yozora/tokenizer-admonition]:
|
|
205
|
-
https://github.com/yozorajs/yozora/tree/v2.3.
|
|
205
|
+
https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/admonition#readme
|
|
206
206
|
[@yozora/tokenizer-autolink]:
|
|
207
|
-
https://github.com/yozorajs/yozora/tree/v2.3.
|
|
207
|
+
https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/autolink#readme
|
|
208
208
|
[@yozora/tokenizer-autolink-extension]:
|
|
209
|
-
https://github.com/yozorajs/yozora/tree/v2.3.
|
|
209
|
+
https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/autolink-extension#readme
|
|
210
210
|
[@yozora/tokenizer-blockquote]:
|
|
211
|
-
https://github.com/yozorajs/yozora/tree/v2.3.
|
|
212
|
-
[@yozora/tokenizer-break]: https://github.com/yozorajs/yozora/tree/v2.3.
|
|
211
|
+
https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/blockquote#readme
|
|
212
|
+
[@yozora/tokenizer-break]: https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/break#readme
|
|
213
213
|
[@yozora/tokenizer-definition]:
|
|
214
|
-
https://github.com/yozorajs/yozora/tree/v2.3.
|
|
215
|
-
[@yozora/tokenizer-delete]: https://github.com/yozorajs/yozora/tree/v2.3.
|
|
214
|
+
https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/definition#readme
|
|
215
|
+
[@yozora/tokenizer-delete]: https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/delete#readme
|
|
216
216
|
[@yozora/tokenizer-ecma-import]:
|
|
217
|
-
https://github.com/yozorajs/yozora/tree/v2.3.
|
|
217
|
+
https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/ecma-import#readme
|
|
218
218
|
[@yozora/tokenizer-emphasis]:
|
|
219
|
-
https://github.com/yozorajs/yozora/tree/v2.3.
|
|
219
|
+
https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/emphasis#readme
|
|
220
220
|
[@yozora/tokenizer-fenced-block]:
|
|
221
|
-
https://github.com/yozorajs/yozora/tree/v2.3.
|
|
221
|
+
https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/fenced-block#readme
|
|
222
222
|
[@yozora/tokenizer-fenced-code]:
|
|
223
|
-
https://github.com/yozorajs/yozora/tree/v2.3.
|
|
223
|
+
https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/fenced-code#readme
|
|
224
224
|
[@yozora/tokenizer-footnote]:
|
|
225
|
-
https://github.com/yozorajs/yozora/tree/v2.3.
|
|
225
|
+
https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/footnote#readme
|
|
226
226
|
[@yozora/tokenizer-footnote-definition]:
|
|
227
|
-
https://github.com/yozorajs/yozora/tree/v2.3.
|
|
227
|
+
https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/footnote-definition#readme
|
|
228
228
|
[@yozora/tokenizer-footnote-reference]:
|
|
229
|
-
https://github.com/yozorajs/yozora/tree/v2.3.
|
|
229
|
+
https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/footnote-reference#readme
|
|
230
230
|
[@yozora/tokenizer-heading]:
|
|
231
|
-
https://github.com/yozorajs/yozora/tree/v2.3.
|
|
231
|
+
https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/heading#readme
|
|
232
232
|
[@yozora/tokenizer-html-block]:
|
|
233
|
-
https://github.com/yozorajs/yozora/tree/v2.3.
|
|
233
|
+
https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/html-block#readme
|
|
234
234
|
[@yozora/tokenizer-html-inline]:
|
|
235
|
-
https://github.com/yozorajs/yozora/tree/v2.3.
|
|
236
|
-
[@yozora/tokenizer-image]: https://github.com/yozorajs/yozora/tree/v2.3.
|
|
235
|
+
https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/html-inline#readme
|
|
236
|
+
[@yozora/tokenizer-image]: https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/image#readme
|
|
237
237
|
[@yozora/tokenizer-image-reference]:
|
|
238
|
-
https://github.com/yozorajs/yozora/tree/v2.3.
|
|
238
|
+
https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/image-reference#readme
|
|
239
239
|
[@yozora/tokenizer-indented-code]:
|
|
240
|
-
https://github.com/yozorajs/yozora/tree/v2.3.
|
|
240
|
+
https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/indented-code#readme
|
|
241
241
|
[@yozora/tokenizer-inline-code]:
|
|
242
|
-
https://github.com/yozorajs/yozora/tree/v2.3.
|
|
242
|
+
https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/inline-code#readme
|
|
243
243
|
[@yozora/tokenizer-inline-math]:
|
|
244
|
-
https://github.com/yozorajs/yozora/tree/v2.3.
|
|
245
|
-
[@yozora/tokenizer-link]: https://github.com/yozorajs/yozora/tree/v2.3.
|
|
244
|
+
https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/inline-math#readme
|
|
245
|
+
[@yozora/tokenizer-link]: https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/link#readme
|
|
246
246
|
[@yozora/tokenizer-link-reference]:
|
|
247
|
-
https://github.com/yozorajs/yozora/tree/v2.3.
|
|
248
|
-
[@yozora/tokenizer-list]: https://github.com/yozorajs/yozora/tree/v2.3.
|
|
249
|
-
[@yozora/tokenizer-math]: https://github.com/yozorajs/yozora/tree/v2.3.
|
|
247
|
+
https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/link-reference#readme
|
|
248
|
+
[@yozora/tokenizer-list]: https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/list#readme
|
|
249
|
+
[@yozora/tokenizer-math]: https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/math#readme
|
|
250
250
|
[@yozora/tokenizer-paragraph]:
|
|
251
|
-
https://github.com/yozorajs/yozora/tree/v2.3.
|
|
251
|
+
https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/paragraph#readme
|
|
252
252
|
[@yozora/tokenizer-setext-heading]:
|
|
253
|
-
https://github.com/yozorajs/yozora/tree/v2.3.
|
|
254
|
-
[@yozora/tokenizer-table]: https://github.com/yozorajs/yozora/tree/v2.3.
|
|
255
|
-
[@yozora/tokenizer-text]: https://github.com/yozorajs/yozora/tree/v2.3.
|
|
253
|
+
https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/setext-heading#readme
|
|
254
|
+
[@yozora/tokenizer-table]: https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/table#readme
|
|
255
|
+
[@yozora/tokenizer-text]: https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/text#readme
|
|
256
256
|
[@yozora/tokenizer-thematic-break]:
|
|
257
|
-
https://github.com/yozorajs/yozora/tree/v2.3.
|
|
257
|
+
https://github.com/yozorajs/yozora/tree/v2.3.10/tokenizers/thematic-break#readme
|
|
258
258
|
[@yozora/react-admonition]:
|
|
259
259
|
https://github.com/yozorajs/yozora-react/tree/main/packages/admonition#readme
|
|
260
260
|
[@yozora/react-blockquote]:
|
package/lib/cjs/index.cjs
CHANGED
|
@@ -23,14 +23,12 @@ const match = function (api) {
|
|
|
23
23
|
i += 1;
|
|
24
24
|
break;
|
|
25
25
|
case character.AsciiCodePoint.DOLLAR_SIGN: {
|
|
26
|
-
const leftCodePoint = i === blockStartIndex ? null : nodePoints[i - 1].codePoint;
|
|
27
26
|
const _startIndex = i;
|
|
27
|
+
const leftCodePoint = i === blockStartIndex ? null : nodePoints[i - 1].codePoint;
|
|
28
28
|
i = coreTokenizer.eatOptionalCharacters(nodePoints, i + 1, blockEndIndex, character.AsciiCodePoint.DOLLAR_SIGN);
|
|
29
29
|
const rightCodePoint = i === blockEndIndex ? null : nodePoints[i].codePoint;
|
|
30
|
-
const isPotentialOpener = (leftCodePoint
|
|
31
|
-
|
|
32
|
-
const isPotentialCloser = (leftCodePoint === null || !character.isWhitespaceCharacter(leftCodePoint)) &&
|
|
33
|
-
(rightCodePoint === null || character.isWhitespaceCharacter(rightCodePoint));
|
|
30
|
+
const isPotentialOpener = checkIfPotentialOpener(leftCodePoint, rightCodePoint);
|
|
31
|
+
const isPotentialCloser = checkIfPotentialCloser(leftCodePoint, rightCodePoint);
|
|
34
32
|
if (!isPotentialOpener && !isPotentialCloser)
|
|
35
33
|
break;
|
|
36
34
|
const delimiterType = isPotentialOpener
|
|
@@ -50,21 +48,42 @@ const match = function (api) {
|
|
|
50
48
|
}
|
|
51
49
|
return null;
|
|
52
50
|
}
|
|
53
|
-
function isDelimiterPair(openerDelimiter, closerDelimiter) {
|
|
54
|
-
if (openerDelimiter.thickness === closerDelimiter.thickness)
|
|
55
|
-
return { paired: true };
|
|
56
|
-
return { paired: false, opener: true, closer: true };
|
|
57
|
-
}
|
|
58
|
-
function processDelimiterPair(openerDelimiter, closerDelimiter) {
|
|
59
|
-
const token = {
|
|
60
|
-
nodeType: ast.InlineMathType,
|
|
61
|
-
startIndex: openerDelimiter.startIndex,
|
|
62
|
-
endIndex: closerDelimiter.endIndex,
|
|
63
|
-
thickness: openerDelimiter.thickness,
|
|
64
|
-
};
|
|
65
|
-
return { tokens: [token] };
|
|
66
|
-
}
|
|
67
51
|
};
|
|
52
|
+
function checkIfPotentialOpener(leftCodePoint, rightCodePoint) {
|
|
53
|
+
if (rightCodePoint === null)
|
|
54
|
+
return false;
|
|
55
|
+
if (leftCodePoint === character.AsciiCodePoint.BACKTICK)
|
|
56
|
+
return false;
|
|
57
|
+
if (leftCodePoint === null)
|
|
58
|
+
return true;
|
|
59
|
+
return character.isWhitespaceCharacter(leftCodePoint) || character.isPunctuationCharacter(leftCodePoint);
|
|
60
|
+
}
|
|
61
|
+
function checkIfPotentialCloser(leftCodePoint, rightCodePoint) {
|
|
62
|
+
if (leftCodePoint === null)
|
|
63
|
+
return false;
|
|
64
|
+
if (rightCodePoint === character.AsciiCodePoint.BACKTICK)
|
|
65
|
+
return false;
|
|
66
|
+
if (rightCodePoint === null)
|
|
67
|
+
return true;
|
|
68
|
+
return character.isWhitespaceCharacter(rightCodePoint) || character.isPunctuationCharacter(rightCodePoint);
|
|
69
|
+
}
|
|
70
|
+
function isDelimiterPair(openerDelimiter, closerDelimiter) {
|
|
71
|
+
if (openerDelimiter.thickness === closerDelimiter.thickness &&
|
|
72
|
+
(openerDelimiter.type === 'opener' || openerDelimiter.type === 'both') &&
|
|
73
|
+
(closerDelimiter.type === 'closer' || closerDelimiter.type === 'both')) {
|
|
74
|
+
return { paired: true };
|
|
75
|
+
}
|
|
76
|
+
return { paired: false, opener: true, closer: true };
|
|
77
|
+
}
|
|
78
|
+
function processDelimiterPair(openerDelimiter, closerDelimiter) {
|
|
79
|
+
const token = {
|
|
80
|
+
nodeType: ast.InlineMathType,
|
|
81
|
+
startIndex: openerDelimiter.startIndex,
|
|
82
|
+
endIndex: closerDelimiter.endIndex,
|
|
83
|
+
thickness: openerDelimiter.thickness,
|
|
84
|
+
};
|
|
85
|
+
return { tokens: [token] };
|
|
86
|
+
}
|
|
68
87
|
|
|
69
88
|
const parse = function (api) {
|
|
70
89
|
return {
|
package/lib/esm/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InlineMathType } from '@yozora/ast';
|
|
2
|
-
import { AsciiCodePoint, isWhitespaceCharacter, isSpaceLike, calcStringFromNodePoints } from '@yozora/character';
|
|
2
|
+
import { AsciiCodePoint, isWhitespaceCharacter, isPunctuationCharacter, isSpaceLike, calcStringFromNodePoints } from '@yozora/character';
|
|
3
3
|
import { genFindDelimiter, eatOptionalCharacters, BaseInlineTokenizer, TokenizerPriority } from '@yozora/core-tokenizer';
|
|
4
4
|
|
|
5
5
|
const match = function (api) {
|
|
@@ -19,14 +19,12 @@ const match = function (api) {
|
|
|
19
19
|
i += 1;
|
|
20
20
|
break;
|
|
21
21
|
case AsciiCodePoint.DOLLAR_SIGN: {
|
|
22
|
-
const leftCodePoint = i === blockStartIndex ? null : nodePoints[i - 1].codePoint;
|
|
23
22
|
const _startIndex = i;
|
|
23
|
+
const leftCodePoint = i === blockStartIndex ? null : nodePoints[i - 1].codePoint;
|
|
24
24
|
i = eatOptionalCharacters(nodePoints, i + 1, blockEndIndex, AsciiCodePoint.DOLLAR_SIGN);
|
|
25
25
|
const rightCodePoint = i === blockEndIndex ? null : nodePoints[i].codePoint;
|
|
26
|
-
const isPotentialOpener = (leftCodePoint
|
|
27
|
-
|
|
28
|
-
const isPotentialCloser = (leftCodePoint === null || !isWhitespaceCharacter(leftCodePoint)) &&
|
|
29
|
-
(rightCodePoint === null || isWhitespaceCharacter(rightCodePoint));
|
|
26
|
+
const isPotentialOpener = checkIfPotentialOpener(leftCodePoint, rightCodePoint);
|
|
27
|
+
const isPotentialCloser = checkIfPotentialCloser(leftCodePoint, rightCodePoint);
|
|
30
28
|
if (!isPotentialOpener && !isPotentialCloser)
|
|
31
29
|
break;
|
|
32
30
|
const delimiterType = isPotentialOpener
|
|
@@ -46,21 +44,42 @@ const match = function (api) {
|
|
|
46
44
|
}
|
|
47
45
|
return null;
|
|
48
46
|
}
|
|
49
|
-
function isDelimiterPair(openerDelimiter, closerDelimiter) {
|
|
50
|
-
if (openerDelimiter.thickness === closerDelimiter.thickness)
|
|
51
|
-
return { paired: true };
|
|
52
|
-
return { paired: false, opener: true, closer: true };
|
|
53
|
-
}
|
|
54
|
-
function processDelimiterPair(openerDelimiter, closerDelimiter) {
|
|
55
|
-
const token = {
|
|
56
|
-
nodeType: InlineMathType,
|
|
57
|
-
startIndex: openerDelimiter.startIndex,
|
|
58
|
-
endIndex: closerDelimiter.endIndex,
|
|
59
|
-
thickness: openerDelimiter.thickness,
|
|
60
|
-
};
|
|
61
|
-
return { tokens: [token] };
|
|
62
|
-
}
|
|
63
47
|
};
|
|
48
|
+
function checkIfPotentialOpener(leftCodePoint, rightCodePoint) {
|
|
49
|
+
if (rightCodePoint === null)
|
|
50
|
+
return false;
|
|
51
|
+
if (leftCodePoint === AsciiCodePoint.BACKTICK)
|
|
52
|
+
return false;
|
|
53
|
+
if (leftCodePoint === null)
|
|
54
|
+
return true;
|
|
55
|
+
return isWhitespaceCharacter(leftCodePoint) || isPunctuationCharacter(leftCodePoint);
|
|
56
|
+
}
|
|
57
|
+
function checkIfPotentialCloser(leftCodePoint, rightCodePoint) {
|
|
58
|
+
if (leftCodePoint === null)
|
|
59
|
+
return false;
|
|
60
|
+
if (rightCodePoint === AsciiCodePoint.BACKTICK)
|
|
61
|
+
return false;
|
|
62
|
+
if (rightCodePoint === null)
|
|
63
|
+
return true;
|
|
64
|
+
return isWhitespaceCharacter(rightCodePoint) || isPunctuationCharacter(rightCodePoint);
|
|
65
|
+
}
|
|
66
|
+
function isDelimiterPair(openerDelimiter, closerDelimiter) {
|
|
67
|
+
if (openerDelimiter.thickness === closerDelimiter.thickness &&
|
|
68
|
+
(openerDelimiter.type === 'opener' || openerDelimiter.type === 'both') &&
|
|
69
|
+
(closerDelimiter.type === 'closer' || closerDelimiter.type === 'both')) {
|
|
70
|
+
return { paired: true };
|
|
71
|
+
}
|
|
72
|
+
return { paired: false, opener: true, closer: true };
|
|
73
|
+
}
|
|
74
|
+
function processDelimiterPair(openerDelimiter, closerDelimiter) {
|
|
75
|
+
const token = {
|
|
76
|
+
nodeType: InlineMathType,
|
|
77
|
+
startIndex: openerDelimiter.startIndex,
|
|
78
|
+
endIndex: closerDelimiter.endIndex,
|
|
79
|
+
thickness: openerDelimiter.thickness,
|
|
80
|
+
};
|
|
81
|
+
return { tokens: [token] };
|
|
82
|
+
}
|
|
64
83
|
|
|
65
84
|
const parse = function (api) {
|
|
66
85
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yozora/tokenizer-inline-math",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.10",
|
|
4
4
|
"description": "Tokenizer for processing inline math (formulas)",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "guanghechen",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"url": "https://github.com/yozorajs/yozora.git",
|
|
12
12
|
"directory": "tokenizers/inline-math"
|
|
13
13
|
},
|
|
14
|
-
"homepage": "https://github.com/yozorajs/yozora/tree/v2.3.
|
|
14
|
+
"homepage": "https://github.com/yozorajs/yozora/tree/v2.3.9/tokenizers/inline-math",
|
|
15
15
|
"keywords": [
|
|
16
16
|
"yozora",
|
|
17
17
|
"markdown",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"README.md"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@yozora/ast": "^2.3.
|
|
48
|
-
"@yozora/character": "^2.3.
|
|
49
|
-
"@yozora/core-tokenizer": "^2.3.
|
|
47
|
+
"@yozora/ast": "^2.3.10",
|
|
48
|
+
"@yozora/character": "^2.3.10",
|
|
49
|
+
"@yozora/core-tokenizer": "^2.3.10"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "a36b4ddca579a3d20bf2ab68b9e31eaa3f03e423"
|
|
52
52
|
}
|