@yozora/tokenizer-html-inline 1.3.0 → 2.0.0-alpha.0

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/lib/cjs/index.js CHANGED
@@ -2,12 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var ast = require('@yozora/ast');
6
5
  var character = require('@yozora/character');
7
6
  var coreTokenizer = require('@yozora/core-tokenizer');
8
7
  var tokenizerHtmlBlock = require('@yozora/tokenizer-html-block');
9
-
10
- const uniqueName = '@yozora/tokenizer-html-inline';
8
+ var ast = require('@yozora/ast');
11
9
 
12
10
  function eatHtmlInlineCDataDelimiter(nodePoints, startIndex, endIndex) {
13
11
  let i = startIndex;
@@ -108,8 +106,7 @@ function eatHtmlInlineCommentDelimiter(nodePoints, startIndex, endIndex) {
108
106
 
109
107
  function eatHtmlInlineDeclarationDelimiter(nodePoints, startIndex, endIndex) {
110
108
  let i = startIndex;
111
- if (i + 4 >= endIndex ||
112
- nodePoints[i + 1].codePoint !== character.AsciiCodePoint.EXCLAMATION_MARK)
109
+ if (i + 4 >= endIndex || nodePoints[i + 1].codePoint !== character.AsciiCodePoint.EXCLAMATION_MARK)
113
110
  return null;
114
111
  const tagNameStartIndex = i + 2;
115
112
  for (i = tagNameStartIndex; i < endIndex; ++i) {
@@ -143,8 +140,7 @@ function eatHtmlInlineDeclarationDelimiter(nodePoints, startIndex, endIndex) {
143
140
 
144
141
  function eatHtmlInlineInstructionDelimiter(nodePoints, startIndex, endIndex) {
145
142
  let i = startIndex;
146
- if (i + 3 >= endIndex ||
147
- nodePoints[i + 1].codePoint !== character.AsciiCodePoint.QUESTION_MARK)
143
+ if (i + 3 >= endIndex || nodePoints[i + 1].codePoint !== character.AsciiCodePoint.QUESTION_MARK)
148
144
  return null;
149
145
  const si = i + 2;
150
146
  for (i = si; i < endIndex; ++i) {
@@ -207,6 +203,8 @@ function eatHtmlInlineTokenOpenDelimiter(nodePoints, startIndex, endIndex) {
207
203
  return delimiter;
208
204
  }
209
205
 
206
+ const uniqueName = '@yozora/tokenizer-html-inline';
207
+
210
208
  class HtmlInlineTokenizer extends coreTokenizer.BaseInlineTokenizer {
211
209
  constructor(props = {}) {
212
210
  var _a, _b;
@@ -214,64 +212,72 @@ class HtmlInlineTokenizer extends coreTokenizer.BaseInlineTokenizer {
214
212
  name: (_a = props.name) !== null && _a !== void 0 ? _a : uniqueName,
215
213
  priority: (_b = props.priority) !== null && _b !== void 0 ? _b : coreTokenizer.TokenizerPriority.ATOMIC,
216
214
  });
217
- }
218
- _findDelimiter(startIndex, endIndex, api) {
219
- const nodePoints = api.getNodePoints();
220
- for (let i = startIndex; i < endIndex; ++i) {
221
- i = coreTokenizer.eatOptionalWhitespaces(nodePoints, i, endIndex);
222
- if (i >= endIndex)
223
- break;
224
- const c = nodePoints[i].codePoint;
225
- switch (c) {
226
- case character.AsciiCodePoint.BACKSLASH:
227
- i += 1;
228
- break;
229
- case character.AsciiCodePoint.OPEN_ANGLE: {
230
- const delimiter = this.tryToEatDelimiter(nodePoints, i, endIndex);
231
- if (delimiter != null)
232
- return delimiter;
233
- break;
215
+ this.match = api => {
216
+ return {
217
+ findDelimiter: () => coreTokenizer.genFindDelimiter(_findDelimiter),
218
+ processSingleDelimiter,
219
+ };
220
+ function _findDelimiter(startIndex, endIndex) {
221
+ const nodePoints = api.getNodePoints();
222
+ for (let i = startIndex; i < endIndex; ++i) {
223
+ i = coreTokenizer.eatOptionalWhitespaces(nodePoints, i, endIndex);
224
+ if (i >= endIndex)
225
+ break;
226
+ const c = nodePoints[i].codePoint;
227
+ switch (c) {
228
+ case character.AsciiCodePoint.BACKSLASH:
229
+ i += 1;
230
+ break;
231
+ case character.AsciiCodePoint.OPEN_ANGLE: {
232
+ const delimiter = tryToEatDelimiter(nodePoints, i, endIndex);
233
+ if (delimiter != null)
234
+ return delimiter;
235
+ break;
236
+ }
237
+ }
234
238
  }
239
+ return null;
235
240
  }
236
- }
237
- return null;
238
- }
239
- processSingleDelimiter(delimiter) {
240
- const token = Object.assign(Object.assign({}, delimiter), { nodeType: ast.HtmlType });
241
- return [token];
242
- }
243
- parseInline(token, children, api) {
244
- const { startIndex, endIndex } = token;
245
- const nodePoints = api.getNodePoints();
246
- const value = character.calcStringFromNodePoints(nodePoints, startIndex, endIndex);
247
- const result = { type: ast.HtmlType, value };
248
- return result;
241
+ function processSingleDelimiter(delimiter) {
242
+ const token = Object.assign(Object.assign({}, delimiter), { nodeType: ast.HtmlType });
243
+ return [token];
244
+ }
245
+ };
246
+ this.parse = api => ({
247
+ parse: token => {
248
+ const { startIndex, endIndex } = token;
249
+ const nodePoints = api.getNodePoints();
250
+ const value = character.calcStringFromNodePoints(nodePoints, startIndex, endIndex);
251
+ const result = { type: ast.HtmlType, value };
252
+ return result;
253
+ },
254
+ });
249
255
  }
250
- tryToEatDelimiter(nodePoints, startIndex, endIndex) {
251
- let delimiter = null;
252
- delimiter = eatHtmlInlineTokenOpenDelimiter(nodePoints, startIndex, endIndex);
253
- if (delimiter != null)
254
- return delimiter;
255
- delimiter = eatHtmlInlineClosingDelimiter(nodePoints, startIndex, endIndex);
256
- if (delimiter != null)
257
- return delimiter;
258
- delimiter = eatHtmlInlineCommentDelimiter(nodePoints, startIndex, endIndex);
259
- if (delimiter != null)
260
- return delimiter;
261
- delimiter = eatHtmlInlineInstructionDelimiter(nodePoints, startIndex, endIndex);
262
- if (delimiter != null)
263
- return delimiter;
264
- delimiter = eatHtmlInlineDeclarationDelimiter(nodePoints, startIndex, endIndex);
265
- if (delimiter != null)
266
- return delimiter;
267
- delimiter = eatHtmlInlineCDataDelimiter(nodePoints, startIndex, endIndex);
256
+ }
257
+ function tryToEatDelimiter(nodePoints, startIndex, endIndex) {
258
+ let delimiter = null;
259
+ delimiter = eatHtmlInlineTokenOpenDelimiter(nodePoints, startIndex, endIndex);
260
+ if (delimiter != null)
268
261
  return delimiter;
269
- }
262
+ delimiter = eatHtmlInlineClosingDelimiter(nodePoints, startIndex, endIndex);
263
+ if (delimiter != null)
264
+ return delimiter;
265
+ delimiter = eatHtmlInlineCommentDelimiter(nodePoints, startIndex, endIndex);
266
+ if (delimiter != null)
267
+ return delimiter;
268
+ delimiter = eatHtmlInlineInstructionDelimiter(nodePoints, startIndex, endIndex);
269
+ if (delimiter != null)
270
+ return delimiter;
271
+ delimiter = eatHtmlInlineDeclarationDelimiter(nodePoints, startIndex, endIndex);
272
+ if (delimiter != null)
273
+ return delimiter;
274
+ delimiter = eatHtmlInlineCDataDelimiter(nodePoints, startIndex, endIndex);
275
+ return delimiter;
270
276
  }
271
277
 
272
278
  exports.HtmlInlineTokenizer = HtmlInlineTokenizer;
273
279
  exports.HtmlInlineTokenizerName = uniqueName;
274
- exports['default'] = HtmlInlineTokenizer;
280
+ exports["default"] = HtmlInlineTokenizer;
275
281
  exports.eatHtmlInlineCDataDelimiter = eatHtmlInlineCDataDelimiter;
276
282
  exports.eatHtmlInlineClosingDelimiter = eatHtmlInlineClosingDelimiter;
277
283
  exports.eatHtmlInlineCommentDelimiter = eatHtmlInlineCommentDelimiter;
package/lib/esm/index.js CHANGED
@@ -1,9 +1,7 @@
1
- import { HtmlType } from '@yozora/ast';
2
1
  import { AsciiCodePoint, isAsciiUpperLetter, isWhitespaceCharacter, calcStringFromNodePoints } from '@yozora/character';
3
- import { eatOptionalWhitespaces, BaseInlineTokenizer, TokenizerPriority } from '@yozora/core-tokenizer';
2
+ import { eatOptionalWhitespaces, BaseInlineTokenizer, TokenizerPriority, genFindDelimiter } from '@yozora/core-tokenizer';
4
3
  import { eatHTMLTagName, eatHTMLAttribute } from '@yozora/tokenizer-html-block';
5
-
6
- const uniqueName = '@yozora/tokenizer-html-inline';
4
+ import { HtmlType } from '@yozora/ast';
7
5
 
8
6
  function eatHtmlInlineCDataDelimiter(nodePoints, startIndex, endIndex) {
9
7
  let i = startIndex;
@@ -104,8 +102,7 @@ function eatHtmlInlineCommentDelimiter(nodePoints, startIndex, endIndex) {
104
102
 
105
103
  function eatHtmlInlineDeclarationDelimiter(nodePoints, startIndex, endIndex) {
106
104
  let i = startIndex;
107
- if (i + 4 >= endIndex ||
108
- nodePoints[i + 1].codePoint !== AsciiCodePoint.EXCLAMATION_MARK)
105
+ if (i + 4 >= endIndex || nodePoints[i + 1].codePoint !== AsciiCodePoint.EXCLAMATION_MARK)
109
106
  return null;
110
107
  const tagNameStartIndex = i + 2;
111
108
  for (i = tagNameStartIndex; i < endIndex; ++i) {
@@ -139,8 +136,7 @@ function eatHtmlInlineDeclarationDelimiter(nodePoints, startIndex, endIndex) {
139
136
 
140
137
  function eatHtmlInlineInstructionDelimiter(nodePoints, startIndex, endIndex) {
141
138
  let i = startIndex;
142
- if (i + 3 >= endIndex ||
143
- nodePoints[i + 1].codePoint !== AsciiCodePoint.QUESTION_MARK)
139
+ if (i + 3 >= endIndex || nodePoints[i + 1].codePoint !== AsciiCodePoint.QUESTION_MARK)
144
140
  return null;
145
141
  const si = i + 2;
146
142
  for (i = si; i < endIndex; ++i) {
@@ -203,6 +199,8 @@ function eatHtmlInlineTokenOpenDelimiter(nodePoints, startIndex, endIndex) {
203
199
  return delimiter;
204
200
  }
205
201
 
202
+ const uniqueName = '@yozora/tokenizer-html-inline';
203
+
206
204
  class HtmlInlineTokenizer extends BaseInlineTokenizer {
207
205
  constructor(props = {}) {
208
206
  var _a, _b;
@@ -210,59 +208,67 @@ class HtmlInlineTokenizer extends BaseInlineTokenizer {
210
208
  name: (_a = props.name) !== null && _a !== void 0 ? _a : uniqueName,
211
209
  priority: (_b = props.priority) !== null && _b !== void 0 ? _b : TokenizerPriority.ATOMIC,
212
210
  });
213
- }
214
- _findDelimiter(startIndex, endIndex, api) {
215
- const nodePoints = api.getNodePoints();
216
- for (let i = startIndex; i < endIndex; ++i) {
217
- i = eatOptionalWhitespaces(nodePoints, i, endIndex);
218
- if (i >= endIndex)
219
- break;
220
- const c = nodePoints[i].codePoint;
221
- switch (c) {
222
- case AsciiCodePoint.BACKSLASH:
223
- i += 1;
224
- break;
225
- case AsciiCodePoint.OPEN_ANGLE: {
226
- const delimiter = this.tryToEatDelimiter(nodePoints, i, endIndex);
227
- if (delimiter != null)
228
- return delimiter;
229
- break;
211
+ this.match = api => {
212
+ return {
213
+ findDelimiter: () => genFindDelimiter(_findDelimiter),
214
+ processSingleDelimiter,
215
+ };
216
+ function _findDelimiter(startIndex, endIndex) {
217
+ const nodePoints = api.getNodePoints();
218
+ for (let i = startIndex; i < endIndex; ++i) {
219
+ i = eatOptionalWhitespaces(nodePoints, i, endIndex);
220
+ if (i >= endIndex)
221
+ break;
222
+ const c = nodePoints[i].codePoint;
223
+ switch (c) {
224
+ case AsciiCodePoint.BACKSLASH:
225
+ i += 1;
226
+ break;
227
+ case AsciiCodePoint.OPEN_ANGLE: {
228
+ const delimiter = tryToEatDelimiter(nodePoints, i, endIndex);
229
+ if (delimiter != null)
230
+ return delimiter;
231
+ break;
232
+ }
233
+ }
230
234
  }
235
+ return null;
231
236
  }
232
- }
233
- return null;
234
- }
235
- processSingleDelimiter(delimiter) {
236
- const token = Object.assign(Object.assign({}, delimiter), { nodeType: HtmlType });
237
- return [token];
238
- }
239
- parseInline(token, children, api) {
240
- const { startIndex, endIndex } = token;
241
- const nodePoints = api.getNodePoints();
242
- const value = calcStringFromNodePoints(nodePoints, startIndex, endIndex);
243
- const result = { type: HtmlType, value };
244
- return result;
237
+ function processSingleDelimiter(delimiter) {
238
+ const token = Object.assign(Object.assign({}, delimiter), { nodeType: HtmlType });
239
+ return [token];
240
+ }
241
+ };
242
+ this.parse = api => ({
243
+ parse: token => {
244
+ const { startIndex, endIndex } = token;
245
+ const nodePoints = api.getNodePoints();
246
+ const value = calcStringFromNodePoints(nodePoints, startIndex, endIndex);
247
+ const result = { type: HtmlType, value };
248
+ return result;
249
+ },
250
+ });
245
251
  }
246
- tryToEatDelimiter(nodePoints, startIndex, endIndex) {
247
- let delimiter = null;
248
- delimiter = eatHtmlInlineTokenOpenDelimiter(nodePoints, startIndex, endIndex);
249
- if (delimiter != null)
250
- return delimiter;
251
- delimiter = eatHtmlInlineClosingDelimiter(nodePoints, startIndex, endIndex);
252
- if (delimiter != null)
253
- return delimiter;
254
- delimiter = eatHtmlInlineCommentDelimiter(nodePoints, startIndex, endIndex);
255
- if (delimiter != null)
256
- return delimiter;
257
- delimiter = eatHtmlInlineInstructionDelimiter(nodePoints, startIndex, endIndex);
258
- if (delimiter != null)
259
- return delimiter;
260
- delimiter = eatHtmlInlineDeclarationDelimiter(nodePoints, startIndex, endIndex);
261
- if (delimiter != null)
262
- return delimiter;
263
- delimiter = eatHtmlInlineCDataDelimiter(nodePoints, startIndex, endIndex);
252
+ }
253
+ function tryToEatDelimiter(nodePoints, startIndex, endIndex) {
254
+ let delimiter = null;
255
+ delimiter = eatHtmlInlineTokenOpenDelimiter(nodePoints, startIndex, endIndex);
256
+ if (delimiter != null)
264
257
  return delimiter;
265
- }
258
+ delimiter = eatHtmlInlineClosingDelimiter(nodePoints, startIndex, endIndex);
259
+ if (delimiter != null)
260
+ return delimiter;
261
+ delimiter = eatHtmlInlineCommentDelimiter(nodePoints, startIndex, endIndex);
262
+ if (delimiter != null)
263
+ return delimiter;
264
+ delimiter = eatHtmlInlineInstructionDelimiter(nodePoints, startIndex, endIndex);
265
+ if (delimiter != null)
266
+ return delimiter;
267
+ delimiter = eatHtmlInlineDeclarationDelimiter(nodePoints, startIndex, endIndex);
268
+ if (delimiter != null)
269
+ return delimiter;
270
+ delimiter = eatHtmlInlineCDataDelimiter(nodePoints, startIndex, endIndex);
271
+ return delimiter;
266
272
  }
267
273
 
268
274
  export { HtmlInlineTokenizer, uniqueName as HtmlInlineTokenizerName, HtmlInlineTokenizer as default, eatHtmlInlineCDataDelimiter, eatHtmlInlineClosingDelimiter, eatHtmlInlineCommentDelimiter, eatHtmlInlineDeclarationDelimiter, eatHtmlInlineInstructionDelimiter, eatHtmlInlineTokenOpenDelimiter };
@@ -1,11 +1,9 @@
1
- import { HtmlInlineTokenizer } from './tokenizer';
2
1
  export * from './util/cdata';
3
2
  export * from './util/closing';
4
3
  export * from './util/comment';
5
4
  export * from './util/declaration';
6
5
  export * from './util/instruction';
7
6
  export * from './util/open';
8
- export { HtmlInlineTokenizer } from './tokenizer';
7
+ export { HtmlInlineTokenizer, HtmlInlineTokenizer as default } from './tokenizer';
9
8
  export { uniqueName as HtmlInlineTokenizerName } from './types';
10
- export type { Token as HtmlInlineToken, TokenizerProps as HtmlInlineTokenizerProps, } from './types';
11
- export default HtmlInlineTokenizer;
9
+ export type { IToken as IHtmlInlineToken, ITokenizerProps as IHtmlInlineTokenizerProps, } from './types';
@@ -1,8 +1,6 @@
1
- import type { YastNode } from '@yozora/ast';
2
- import type { NodePoint } from '@yozora/character';
3
- import type { MatchInlinePhaseApi, ParseInlinePhaseApi, ResultOfProcessSingleDelimiter, Tokenizer, TokenizerMatchInlineHook, TokenizerParseInlineHook } from '@yozora/core-tokenizer';
1
+ import type { IInlineTokenizer, IMatchInlineHookCreator, IParseInlineHookCreator } from '@yozora/core-tokenizer';
4
2
  import { BaseInlineTokenizer } from '@yozora/core-tokenizer';
5
- import type { Delimiter, Node, T, Token, TokenizerProps } from './types';
3
+ import type { IDelimiter, INode, IToken, ITokenizerProps, T } from './types';
6
4
  /**
7
5
  * Lexical Analyzer for HtmlInline.
8
6
  *
@@ -13,29 +11,8 @@ import type { Delimiter, Node, T, Token, TokenizerProps } from './types';
13
11
  *
14
12
  * @see https://github.github.com/gfm/#raw-html
15
13
  */
16
- export declare class HtmlInlineTokenizer extends BaseInlineTokenizer<Delimiter> implements Tokenizer, TokenizerMatchInlineHook<T, Delimiter, Token>, TokenizerParseInlineHook<T, Token, Node> {
17
- constructor(props?: TokenizerProps);
18
- /**
19
- * @override
20
- * @see BaseInlineTokenizer
21
- */
22
- protected _findDelimiter(startIndex: number, endIndex: number, api: Readonly<MatchInlinePhaseApi>): Delimiter | null;
23
- /**
24
- * @override
25
- * @see TokenizerMatchInlineHook
26
- */
27
- processSingleDelimiter(delimiter: Delimiter): ResultOfProcessSingleDelimiter<T, Token>;
28
- /**
29
- * @override
30
- * @see TokenizerParseInlineHook
31
- */
32
- parseInline(token: Token, children: YastNode[], api: Readonly<ParseInlinePhaseApi>): Node;
33
- /**
34
- * Try to eat a delimiter
35
- *
36
- * @param nodePoints
37
- * @param startIndex
38
- * @param endIndex
39
- */
40
- protected tryToEatDelimiter(nodePoints: ReadonlyArray<NodePoint>, startIndex: number, endIndex: number): Delimiter | null;
14
+ export declare class HtmlInlineTokenizer extends BaseInlineTokenizer<T, IDelimiter, IToken, INode> implements IInlineTokenizer<T, IDelimiter, IToken, INode> {
15
+ constructor(props?: ITokenizerProps);
16
+ readonly match: IMatchInlineHookCreator<T, IDelimiter, IToken>;
17
+ readonly parse: IParseInlineHookCreator<T, IToken, INode>;
41
18
  }
@@ -1,13 +1,13 @@
1
- import type { Html, HtmlType } from '@yozora/ast';
2
- import type { BaseInlineTokenizerProps, PartialYastInlineToken } from '@yozora/core-tokenizer';
3
- import type { HtmlInlineCDataDelimiter, HtmlInlineCDataTokenData } from './util/cdata';
4
- import type { HtmlInlineClosingDelimiter, HtmlInlineClosingTokenData } from './util/closing';
5
- import type { HtmlInlineCommentDelimiter, HtmlInlineCommentTokenData } from './util/comment';
6
- import type { HtmlInlineDeclarationDelimiter, HtmlInlineDeclarationTokenData } from './util/declaration';
7
- import type { HtmlInlineInstructionDelimiter, HtmlInlineInstructionTokenData } from './util/instruction';
8
- import type { HtmlInlineOpenDelimiter, HtmlInlineOpenTokenData as HtmlInlineOpenTokenData } from './util/open';
1
+ import type { HtmlType, IHtml } from '@yozora/ast';
2
+ import type { IBaseInlineTokenizerProps, IPartialYastInlineToken } from '@yozora/core-tokenizer';
3
+ import type { IHtmlInlineCDataDelimiter, IHtmlInlineCDataTokenData } from './util/cdata';
4
+ import type { IHtmlInlineClosingDelimiter, IHtmlInlineClosingTokenData } from './util/closing';
5
+ import type { IHtmlInlineCommentDelimiter, IHtmlInlineCommentTokenData } from './util/comment';
6
+ import type { IHtmlInlineDeclarationDelimiter, IHtmlInlineDeclarationTokenData } from './util/declaration';
7
+ import type { IHtmlInlineInstructionDelimiter, IHtmlInlineInstructionTokenData } from './util/instruction';
8
+ import type { IHtmlInlineOpenDelimiter, IHtmlInlineOpenTokenData as IHtmlInlineOpenTokenData } from './util/open';
9
9
  export declare type T = HtmlType;
10
- export declare type Node = Html;
10
+ export declare type INode = IHtml;
11
11
  export declare const uniqueName = "@yozora/tokenizer-html-inline";
12
12
  /**
13
13
  * Text between '<' and '>' that looks like an HTML tag is parsed as a raw
@@ -17,6 +17,6 @@ export declare const uniqueName = "@yozora/tokenizer-html-inline";
17
17
  *
18
18
  * @see https://github.github.com/gfm/#raw-html
19
19
  */
20
- export declare type Token = PartialYastInlineToken<T> & (HtmlInlineOpenTokenData | HtmlInlineClosingTokenData | HtmlInlineCommentTokenData | HtmlInlineInstructionTokenData | HtmlInlineDeclarationTokenData | HtmlInlineCDataTokenData);
21
- export declare type Delimiter = HtmlInlineOpenDelimiter | HtmlInlineClosingDelimiter | HtmlInlineCommentDelimiter | HtmlInlineInstructionDelimiter | HtmlInlineDeclarationDelimiter | HtmlInlineCDataDelimiter;
22
- export declare type TokenizerProps = Partial<BaseInlineTokenizerProps>;
20
+ export declare type IToken = IPartialYastInlineToken<T> & (IHtmlInlineOpenTokenData | IHtmlInlineClosingTokenData | IHtmlInlineCommentTokenData | IHtmlInlineInstructionTokenData | IHtmlInlineDeclarationTokenData | IHtmlInlineCDataTokenData);
21
+ export declare type IDelimiter = IHtmlInlineOpenDelimiter | IHtmlInlineClosingDelimiter | IHtmlInlineCommentDelimiter | IHtmlInlineInstructionDelimiter | IHtmlInlineDeclarationDelimiter | IHtmlInlineCDataDelimiter;
22
+ export declare type ITokenizerProps = Partial<IBaseInlineTokenizerProps>;
@@ -1,12 +1,12 @@
1
- import type { NodePoint } from '@yozora/character';
2
- import type { YastTokenDelimiter } from '@yozora/core-tokenizer';
3
- export interface HtmlInlineCDataData {
1
+ import type { INodePoint } from '@yozora/character';
2
+ import type { IYastTokenDelimiter } from '@yozora/core-tokenizer';
3
+ export interface IHtmlInlineCDataData {
4
4
  htmlType: 'cdata';
5
5
  }
6
- export interface HtmlInlineCDataTokenData {
6
+ export interface IHtmlInlineCDataTokenData {
7
7
  htmlType: 'cdata';
8
8
  }
9
- export interface HtmlInlineCDataDelimiter extends YastTokenDelimiter, HtmlInlineCDataTokenData {
9
+ export interface IHtmlInlineCDataDelimiter extends IYastTokenDelimiter, IHtmlInlineCDataTokenData {
10
10
  type: 'full';
11
11
  }
12
12
  /**
@@ -18,4 +18,4 @@ export interface HtmlInlineCDataDelimiter extends YastTokenDelimiter, HtmlInline
18
18
  * @param endIndex
19
19
  * @see https://github.github.com/gfm/#cdata-section
20
20
  */
21
- export declare function eatHtmlInlineCDataDelimiter(nodePoints: ReadonlyArray<NodePoint>, startIndex: number, endIndex: number): HtmlInlineCDataDelimiter | null;
21
+ export declare function eatHtmlInlineCDataDelimiter(nodePoints: ReadonlyArray<INodePoint>, startIndex: number, endIndex: number): IHtmlInlineCDataDelimiter | null;
@@ -1,14 +1,14 @@
1
- import type { NodeInterval, NodePoint } from '@yozora/character';
2
- import type { YastTokenDelimiter } from '@yozora/core-tokenizer';
3
- export interface HtmlInlineClosingTagData {
1
+ import type { INodeInterval, INodePoint } from '@yozora/character';
2
+ import type { IYastTokenDelimiter } from '@yozora/core-tokenizer';
3
+ export interface IHtmlInlineClosingTagData {
4
4
  htmlType: 'closing';
5
5
  tagName: string;
6
6
  }
7
- export interface HtmlInlineClosingTokenData {
7
+ export interface IHtmlInlineClosingTokenData {
8
8
  htmlType: 'closing';
9
- tagName: NodeInterval;
9
+ tagName: INodeInterval;
10
10
  }
11
- export interface HtmlInlineClosingDelimiter extends YastTokenDelimiter, HtmlInlineClosingTokenData {
11
+ export interface IHtmlInlineClosingDelimiter extends IYastTokenDelimiter, IHtmlInlineClosingTokenData {
12
12
  type: 'full';
13
13
  }
14
14
  /**
@@ -20,4 +20,4 @@ export interface HtmlInlineClosingDelimiter extends YastTokenDelimiter, HtmlInli
20
20
  * @param endIndex
21
21
  * @see https://github.github.com/gfm/#closing-tag
22
22
  */
23
- export declare function eatHtmlInlineClosingDelimiter(nodePoints: ReadonlyArray<NodePoint>, startIndex: number, endIndex: number): HtmlInlineClosingDelimiter | null;
23
+ export declare function eatHtmlInlineClosingDelimiter(nodePoints: ReadonlyArray<INodePoint>, startIndex: number, endIndex: number): IHtmlInlineClosingDelimiter | null;
@@ -1,12 +1,12 @@
1
- import type { NodePoint } from '@yozora/character';
2
- import type { YastTokenDelimiter } from '@yozora/core-tokenizer';
3
- export interface HtmlInlineCommentData {
1
+ import type { INodePoint } from '@yozora/character';
2
+ import type { IYastTokenDelimiter } from '@yozora/core-tokenizer';
3
+ export interface IHtmlInlineCommentData {
4
4
  htmlType: 'comment';
5
5
  }
6
- export interface HtmlInlineCommentTokenData {
6
+ export interface IHtmlInlineCommentTokenData {
7
7
  htmlType: 'comment';
8
8
  }
9
- export interface HtmlInlineCommentDelimiter extends YastTokenDelimiter, HtmlInlineCommentTokenData {
9
+ export interface IHtmlInlineCommentDelimiter extends IYastTokenDelimiter, IHtmlInlineCommentTokenData {
10
10
  type: 'full';
11
11
  }
12
12
  /**
@@ -18,4 +18,4 @@ export interface HtmlInlineCommentDelimiter extends YastTokenDelimiter, HtmlInli
18
18
  * @param endIndex
19
19
  * @see https://github.github.com/gfm/#html-comment
20
20
  */
21
- export declare function eatHtmlInlineCommentDelimiter(nodePoints: ReadonlyArray<NodePoint>, startIndex: number, endIndex: number): HtmlInlineCommentDelimiter | null;
21
+ export declare function eatHtmlInlineCommentDelimiter(nodePoints: ReadonlyArray<INodePoint>, startIndex: number, endIndex: number): IHtmlInlineCommentDelimiter | null;
@@ -1,13 +1,13 @@
1
- import type { NodeInterval, NodePoint } from '@yozora/character';
2
- import type { YastTokenDelimiter } from '@yozora/core-tokenizer';
3
- export interface HtmlInlineDeclarationData {
1
+ import type { INodeInterval, INodePoint } from '@yozora/character';
2
+ import type { IYastTokenDelimiter } from '@yozora/core-tokenizer';
3
+ export interface IHtmlInlineDeclarationData {
4
4
  htmlType: 'declaration';
5
5
  }
6
- export interface HtmlInlineDeclarationTokenData {
6
+ export interface IHtmlInlineDeclarationTokenData {
7
7
  htmlType: 'declaration';
8
- tagName: NodeInterval;
8
+ tagName: INodeInterval;
9
9
  }
10
- export interface HtmlInlineDeclarationDelimiter extends YastTokenDelimiter, HtmlInlineDeclarationTokenData {
10
+ export interface IHtmlInlineDeclarationDelimiter extends IYastTokenDelimiter, IHtmlInlineDeclarationTokenData {
11
11
  type: 'full';
12
12
  }
13
13
  /**
@@ -20,4 +20,4 @@ export interface HtmlInlineDeclarationDelimiter extends YastTokenDelimiter, Html
20
20
  * @param endIndex
21
21
  * @see https://github.github.com/gfm/#declaration
22
22
  */
23
- export declare function eatHtmlInlineDeclarationDelimiter(nodePoints: ReadonlyArray<NodePoint>, startIndex: number, endIndex: number): HtmlInlineDeclarationDelimiter | null;
23
+ export declare function eatHtmlInlineDeclarationDelimiter(nodePoints: ReadonlyArray<INodePoint>, startIndex: number, endIndex: number): IHtmlInlineDeclarationDelimiter | null;
@@ -1,16 +1,16 @@
1
- import type { NodePoint } from '@yozora/character';
2
- import type { YastTokenDelimiter } from '@yozora/core-tokenizer';
1
+ import type { INodePoint } from '@yozora/character';
2
+ import type { IYastTokenDelimiter } from '@yozora/core-tokenizer';
3
3
  /**
4
4
  *
5
5
  * @see https://github.github.com/gfm/#processing-instruction
6
6
  */
7
- export interface HtmlInlineInstructionData {
7
+ export interface IHtmlInlineInstructionData {
8
8
  htmlType: 'instruction';
9
9
  }
10
- export interface HtmlInlineInstructionTokenData {
10
+ export interface IHtmlInlineInstructionTokenData {
11
11
  htmlType: 'instruction';
12
12
  }
13
- export interface HtmlInlineInstructionDelimiter extends YastTokenDelimiter, HtmlInlineInstructionTokenData {
13
+ export interface IHtmlInlineInstructionDelimiter extends IYastTokenDelimiter, IHtmlInlineInstructionTokenData {
14
14
  type: 'full';
15
15
  }
16
16
  /**
@@ -22,4 +22,4 @@ export interface HtmlInlineInstructionDelimiter extends YastTokenDelimiter, Html
22
22
  * @param endIndex
23
23
  * @see https://github.github.com/gfm/#processing-instruction
24
24
  */
25
- export declare function eatHtmlInlineInstructionDelimiter(nodePoints: ReadonlyArray<NodePoint>, startIndex: number, endIndex: number): HtmlInlineInstructionDelimiter | null;
25
+ export declare function eatHtmlInlineInstructionDelimiter(nodePoints: ReadonlyArray<INodePoint>, startIndex: number, endIndex: number): IHtmlInlineInstructionDelimiter | null;
@@ -1,7 +1,7 @@
1
- import type { NodeInterval, NodePoint } from '@yozora/character';
2
- import type { YastTokenDelimiter } from '@yozora/core-tokenizer';
1
+ import type { INodeInterval, INodePoint } from '@yozora/character';
2
+ import type { IYastTokenDelimiter } from '@yozora/core-tokenizer';
3
3
  import type { RawHTMLAttribute } from '@yozora/tokenizer-html-block';
4
- export interface HtmlInlineOpenTagData {
4
+ export interface IHtmlInlineOpenTagData {
5
5
  htmlType: 'open';
6
6
  /**
7
7
  * HTML tag name.
@@ -19,13 +19,13 @@ export interface HtmlInlineOpenTagData {
19
19
  */
20
20
  selfClosed: boolean;
21
21
  }
22
- export interface HtmlInlineOpenTokenData {
22
+ export interface IHtmlInlineOpenTokenData {
23
23
  htmlType: 'open';
24
- tagName: NodeInterval;
24
+ tagName: INodeInterval;
25
25
  attributes: RawHTMLAttribute[];
26
26
  selfClosed: boolean;
27
27
  }
28
- export interface HtmlInlineOpenDelimiter extends YastTokenDelimiter, HtmlInlineOpenTokenData {
28
+ export interface IHtmlInlineOpenDelimiter extends IYastTokenDelimiter, IHtmlInlineOpenTokenData {
29
29
  type: 'full';
30
30
  }
31
31
  /**
@@ -37,4 +37,4 @@ export interface HtmlInlineOpenDelimiter extends YastTokenDelimiter, HtmlInlineO
37
37
  * @param endIndex
38
38
  * @see https://github.github.com/gfm/#open-tag
39
39
  */
40
- export declare function eatHtmlInlineTokenOpenDelimiter(nodePoints: ReadonlyArray<NodePoint>, startIndex: number, endIndex: number): HtmlInlineOpenDelimiter | null;
40
+ export declare function eatHtmlInlineTokenOpenDelimiter(nodePoints: ReadonlyArray<INodePoint>, startIndex: number, endIndex: number): IHtmlInlineOpenDelimiter | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yozora/tokenizer-html-inline",
3
- "version": "1.3.0",
3
+ "version": "2.0.0-alpha.0",
4
4
  "author": {
5
5
  "name": "guanghechen",
6
6
  "url": "https://github.com/guanghechen/"
@@ -35,10 +35,10 @@
35
35
  "test": "cross-env TS_NODE_FILES=true jest --config ../../jest.config.js --rootDir ."
36
36
  },
37
37
  "dependencies": {
38
- "@yozora/ast": "^1.3.0",
39
- "@yozora/character": "^1.3.0",
40
- "@yozora/core-tokenizer": "^1.3.0",
41
- "@yozora/tokenizer-html-block": "^1.3.0"
38
+ "@yozora/ast": "^2.0.0-alpha.0",
39
+ "@yozora/character": "^2.0.0-alpha.0",
40
+ "@yozora/core-tokenizer": "^2.0.0-alpha.0",
41
+ "@yozora/tokenizer-html-block": "^2.0.0-alpha.0"
42
42
  },
43
- "gitHead": "18c9b167004ad97718b2f94f25139f80598cbf7a"
43
+ "gitHead": "0171501339c49ffd02ed16a63447fa20a47a29a7"
44
44
  }