wikilint 2.48.2 → 3.1.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/README.md +1 -1
- package/config/.schema.json +5 -0
- package/data/signatures.json +2 -2
- package/dist/base.d.mts +4 -2
- package/dist/base.d.ts +4 -2
- package/dist/base.js +1 -0
- package/dist/base.mjs +2 -1
- package/dist/bin/config.js +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.js +20 -14
- package/dist/internal.d.ts +1 -0
- package/dist/lib/document.d.ts +7 -6
- package/dist/lib/document.js +3 -1
- package/dist/lib/lintConfig.js +1 -0
- package/dist/lib/lsp.js +9 -7
- package/dist/lib/node.d.ts +0 -4
- package/dist/lib/node.js +8 -0
- package/dist/lib/text.js +4 -3
- package/dist/lib/title.js +6 -1
- package/dist/map.d.ts +2 -1
- package/dist/parser/commentAndExt.js +1 -1
- package/dist/parser/hrAndDoubleUnderscore.js +3 -2
- package/dist/parser/table.js +2 -1
- package/dist/src/arg.d.ts +1 -1
- package/dist/src/arg.js +1 -1
- package/dist/src/attributes.d.ts +4 -3
- package/dist/src/converter.d.ts +1 -1
- package/dist/src/converter.js +1 -1
- package/dist/src/converterRule.d.ts +1 -1
- package/dist/src/converterRule.js +1 -1
- package/dist/src/extLink.d.ts +1 -1
- package/dist/src/extLink.js +1 -1
- package/dist/src/index.js +54 -58
- package/dist/src/link/category.d.ts +1 -1
- package/dist/src/link/category.js +1 -1
- package/dist/src/link/galleryImage.js +1 -1
- package/dist/src/link/index.d.ts +1 -1
- package/dist/src/link/index.js +1 -1
- package/dist/src/link/redirectTarget.d.ts +1 -1
- package/dist/src/link/redirectTarget.js +1 -1
- package/dist/src/magicLink.d.ts +4 -3
- package/dist/src/magicLink.js +1 -1
- package/dist/src/multiLine/gallery.d.ts +4 -4
- package/dist/src/multiLine/gallery.js +13 -4
- package/dist/src/multiLine/imagemap.d.ts +5 -3
- package/dist/src/multiLine/imagemap.js +1 -1
- package/dist/src/nested.d.ts +1 -1
- package/dist/src/nested.js +1 -1
- package/dist/src/nowiki/list.js +6 -3
- package/dist/src/nowiki/listBase.d.ts +24 -0
- package/dist/src/nowiki/listBase.js +104 -0
- package/dist/src/paramLine.d.ts +1 -1
- package/dist/src/paramLine.js +1 -1
- package/dist/src/pre.d.ts +5 -3
- package/dist/src/redirect.d.ts +1 -1
- package/dist/src/redirect.js +1 -1
- package/dist/src/singleLine/charinsertLine.d.ts +1 -1
- package/dist/src/singleLine/charinsertLine.js +1 -1
- package/dist/src/table/index.d.ts +2 -2
- package/dist/src/table/index.js +1 -1
- package/dist/src/table/tr.d.ts +1 -1
- package/dist/src/table/tr.js +1 -1
- package/dist/src/tag/index.d.ts +7 -5
- package/dist/src/tag/index.js +9 -4
- package/dist/src/tagPair/ext.js +1 -1
- package/dist/src/transclude.d.ts +1 -1
- package/dist/src/transclude.js +1 -1
- package/dist/util/debug.js +7 -1
- package/i18n/en.json +1 -0
- package/i18n/zh-hans.json +1 -0
- package/i18n/zh-hant.json +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
package/config/.schema.json
CHANGED
|
@@ -247,6 +247,11 @@
|
|
|
247
247
|
"description": "base URL of the server",
|
|
248
248
|
"type": "string",
|
|
249
249
|
"pattern": "^(?:https?:)?//"
|
|
250
|
+
},
|
|
251
|
+
"capitalLinks": {
|
|
252
|
+
"description": "whether to capitalize the first letter of page titles",
|
|
253
|
+
"type": "boolean",
|
|
254
|
+
"default": true
|
|
250
255
|
}
|
|
251
256
|
},
|
|
252
257
|
"required": [
|
package/data/signatures.json
CHANGED
|
@@ -2658,13 +2658,13 @@
|
|
|
2658
2658
|
"aliases": [
|
|
2659
2659
|
"!"
|
|
2660
2660
|
],
|
|
2661
|
-
"description": "Used to include
|
|
2661
|
+
"description": "Used to include an escaped [pipe](https://en.wikipedia.org/wiki/Vertical_bar) (`|`) character as part of template or parser function arguments to prevent interpretation as a parameter separator during expansion.\n\nSee [help](https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#Escaping_pipe_characters_in_tables) for further explanation."
|
|
2662
2662
|
},
|
|
2663
2663
|
{
|
|
2664
2664
|
"aliases": [
|
|
2665
2665
|
"="
|
|
2666
2666
|
],
|
|
2667
|
-
"description": "Used to include an equal sign.\n\nSee [help](https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#Raw_equal_signs) for further explanation."
|
|
2667
|
+
"description": "Used to include an escaped equal sign (`=`) character as part of template or parser function arguments to prevent interpretation as a name-value separator during expansion.\n\nSee [help](https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#Raw_equal_signs) for further explanation."
|
|
2668
2668
|
},
|
|
2669
2669
|
{
|
|
2670
2670
|
"aliases": [
|
package/dist/base.d.mts
CHANGED
|
@@ -11,11 +11,12 @@ export interface Config {
|
|
|
11
11
|
readonly redirection: string[];
|
|
12
12
|
variable: string[];
|
|
13
13
|
functionHook: string[];
|
|
14
|
+
capitalLinks?: boolean;
|
|
14
15
|
variants: string[];
|
|
15
16
|
articlePath?: string;
|
|
16
17
|
}
|
|
17
18
|
export type ConfigData = Omit<Config, 'excludes'>;
|
|
18
|
-
export type TokenTypes = 'root' | 'plain' | 'redirect' | 'redirect-syntax' | 'redirect-target' | 'translate' | 'translate-attr' | 'translate-inner' | 'tvar' | 'tvar-name' | 'onlyinclude' | 'noinclude' | 'include' | 'comment' | 'ext' | 'ext-attrs' | 'ext-attr-dirty' | 'ext-attr' | 'attr-key' | 'attr-value' | 'ext-inner' | 'arg' | 'arg-name' | 'arg-default' | 'hidden' | 'magic-word' | 'magic-word-name' | 'invoke-function' | 'invoke-module' | 'template' | 'template-name' | 'parameter' | 'parameter-key' | 'parameter-value' | 'heading' | 'heading-title' | 'heading-trail' | 'html' | 'html-attrs' | 'html-attr-dirty' | 'html-attr' | 'table' | 'tr' | 'td' | 'table-syntax' | 'table-attrs' | 'table-attr-dirty' | 'table-attr' | 'table-inter' | 'td-inner' | 'hr' | 'double-underscore' | 'link' | 'link-target' | 'link-text' | 'category' | 'file' | 'gallery-image' | 'imagemap-image' | 'image-parameter' | 'quote' | 'ext-link' | 'ext-link-text' | 'ext-link-url' | 'free-ext-link' | 'magic-link' | 'list' | 'dd' | 'converter' | 'converter-flags' | 'converter-flag' | 'converter-rule' | 'converter-rule-variant' | 'converter-rule-to' | 'converter-rule-from' | 'param-line' | 'param-line-key' | 'param-line-value' | 'imagemap-link' | 'charinsert-line';
|
|
19
|
+
export type TokenTypes = 'root' | 'plain' | 'redirect' | 'redirect-syntax' | 'redirect-target' | 'translate' | 'translate-attr' | 'translate-inner' | 'tvar' | 'tvar-name' | 'onlyinclude' | 'noinclude' | 'include' | 'comment' | 'ext' | 'ext-attrs' | 'ext-attr-dirty' | 'ext-attr' | 'attr-key' | 'attr-value' | 'ext-inner' | 'arg' | 'arg-name' | 'arg-default' | 'hidden' | 'magic-word' | 'magic-word-name' | 'invoke-function' | 'invoke-module' | 'template' | 'template-name' | 'parameter' | 'parameter-key' | 'parameter-value' | 'heading' | 'heading-title' | 'heading-trail' | 'html' | 'html-attrs' | 'html-attr-dirty' | 'html-attr' | 'table' | 'tr' | 'td' | 'table-syntax' | 'table-attrs' | 'table-attr-dirty' | 'table-attr' | 'table-inter' | 'td-inner' | 'hr' | 'double-underscore' | 'link' | 'link-target' | 'link-text' | 'category' | 'file' | 'gallery-image' | 'imagemap-image' | 'image-parameter' | 'quote' | 'ext-link' | 'ext-link-text' | 'ext-link-url' | 'free-ext-link' | 'magic-link' | 'list' | 'dd' | 'converter' | 'converter-flags' | 'converter-flag' | 'converter-rule' | 'converter-rule-variant' | 'converter-rule-to' | 'converter-rule-from' | 'param-line' | 'param-line-key' | 'param-line-value' | 'imagemap-link' | 'charinsert-line' | 'list-range';
|
|
19
20
|
export declare const stages: {
|
|
20
21
|
redirect: number;
|
|
21
22
|
onlyinclude: number;
|
|
@@ -41,8 +42,9 @@ export declare const stages: {
|
|
|
41
42
|
list: number;
|
|
42
43
|
dd: number;
|
|
43
44
|
converter: number;
|
|
45
|
+
'list-range': number;
|
|
44
46
|
};
|
|
45
|
-
|
|
47
|
+
declare type Stage = keyof typeof stages;
|
|
46
48
|
export declare const rules: readonly ["arg-in-ext", "blank-alt", "bold-header", "format-leakage", "fostered-content", "h1", "illegal-attr", "insecure-style", "invalid-gallery", "invalid-imagemap", "invalid-invoke", "invalid-isbn", "invalid-json", "invalid-ref", "invalid-url", "lonely-apos", "lonely-bracket", "lonely-http", "nested-link", "no-arg", "no-duplicate", "no-ignored", "obsolete-attr", "obsolete-tag", "parsing-order", "pipe-like", "required-attr", "syntax-like", "table-layout", "tag-like", "unbalanced-header", "unclosed-comment", "unclosed-quote", "unclosed-table", "unescaped", "unknown-page", "unmatched-tag", "unterminated-url", "url-encoding", "var-anchor", "void-ext", "invalid-css", "invalid-math"];
|
|
47
49
|
export declare namespace LintError {
|
|
48
50
|
type Severity = 'error' | 'warning';
|
package/dist/base.d.ts
CHANGED
|
@@ -11,11 +11,12 @@ export interface Config {
|
|
|
11
11
|
readonly redirection: string[];
|
|
12
12
|
variable: string[];
|
|
13
13
|
functionHook: string[];
|
|
14
|
+
capitalLinks?: boolean;
|
|
14
15
|
variants: string[];
|
|
15
16
|
articlePath?: string;
|
|
16
17
|
}
|
|
17
18
|
export type ConfigData = Omit<Config, 'excludes'>;
|
|
18
|
-
export type TokenTypes = 'root' | 'plain' | 'redirect' | 'redirect-syntax' | 'redirect-target' | 'translate' | 'translate-attr' | 'translate-inner' | 'tvar' | 'tvar-name' | 'onlyinclude' | 'noinclude' | 'include' | 'comment' | 'ext' | 'ext-attrs' | 'ext-attr-dirty' | 'ext-attr' | 'attr-key' | 'attr-value' | 'ext-inner' | 'arg' | 'arg-name' | 'arg-default' | 'hidden' | 'magic-word' | 'magic-word-name' | 'invoke-function' | 'invoke-module' | 'template' | 'template-name' | 'parameter' | 'parameter-key' | 'parameter-value' | 'heading' | 'heading-title' | 'heading-trail' | 'html' | 'html-attrs' | 'html-attr-dirty' | 'html-attr' | 'table' | 'tr' | 'td' | 'table-syntax' | 'table-attrs' | 'table-attr-dirty' | 'table-attr' | 'table-inter' | 'td-inner' | 'hr' | 'double-underscore' | 'link' | 'link-target' | 'link-text' | 'category' | 'file' | 'gallery-image' | 'imagemap-image' | 'image-parameter' | 'quote' | 'ext-link' | 'ext-link-text' | 'ext-link-url' | 'free-ext-link' | 'magic-link' | 'list' | 'dd' | 'converter' | 'converter-flags' | 'converter-flag' | 'converter-rule' | 'converter-rule-variant' | 'converter-rule-to' | 'converter-rule-from' | 'param-line' | 'param-line-key' | 'param-line-value' | 'imagemap-link' | 'charinsert-line';
|
|
19
|
+
export type TokenTypes = 'root' | 'plain' | 'redirect' | 'redirect-syntax' | 'redirect-target' | 'translate' | 'translate-attr' | 'translate-inner' | 'tvar' | 'tvar-name' | 'onlyinclude' | 'noinclude' | 'include' | 'comment' | 'ext' | 'ext-attrs' | 'ext-attr-dirty' | 'ext-attr' | 'attr-key' | 'attr-value' | 'ext-inner' | 'arg' | 'arg-name' | 'arg-default' | 'hidden' | 'magic-word' | 'magic-word-name' | 'invoke-function' | 'invoke-module' | 'template' | 'template-name' | 'parameter' | 'parameter-key' | 'parameter-value' | 'heading' | 'heading-title' | 'heading-trail' | 'html' | 'html-attrs' | 'html-attr-dirty' | 'html-attr' | 'table' | 'tr' | 'td' | 'table-syntax' | 'table-attrs' | 'table-attr-dirty' | 'table-attr' | 'table-inter' | 'td-inner' | 'hr' | 'double-underscore' | 'link' | 'link-target' | 'link-text' | 'category' | 'file' | 'gallery-image' | 'imagemap-image' | 'image-parameter' | 'quote' | 'ext-link' | 'ext-link-text' | 'ext-link-url' | 'free-ext-link' | 'magic-link' | 'list' | 'dd' | 'converter' | 'converter-flags' | 'converter-flag' | 'converter-rule' | 'converter-rule-variant' | 'converter-rule-to' | 'converter-rule-from' | 'param-line' | 'param-line-key' | 'param-line-value' | 'imagemap-link' | 'charinsert-line' | 'list-range';
|
|
19
20
|
export declare const stages: {
|
|
20
21
|
redirect: number;
|
|
21
22
|
onlyinclude: number;
|
|
@@ -41,8 +42,9 @@ export declare const stages: {
|
|
|
41
42
|
list: number;
|
|
42
43
|
dd: number;
|
|
43
44
|
converter: number;
|
|
45
|
+
'list-range': number;
|
|
44
46
|
};
|
|
45
|
-
|
|
47
|
+
declare type Stage = keyof typeof stages;
|
|
46
48
|
export declare const rules: readonly ["arg-in-ext", "blank-alt", "bold-header", "format-leakage", "fostered-content", "h1", "illegal-attr", "insecure-style", "invalid-gallery", "invalid-imagemap", "invalid-invoke", "invalid-isbn", "invalid-json", "invalid-ref", "invalid-url", "lonely-apos", "lonely-bracket", "lonely-http", "nested-link", "no-arg", "no-duplicate", "no-ignored", "obsolete-attr", "obsolete-tag", "parsing-order", "pipe-like", "required-attr", "syntax-like", "table-layout", "tag-like", "unbalanced-header", "unclosed-comment", "unclosed-quote", "unclosed-table", "unescaped", "unknown-page", "unmatched-tag", "unterminated-url", "url-encoding", "var-anchor", "void-ext", "invalid-css", "invalid-math"];
|
|
47
49
|
export declare namespace LintError {
|
|
48
50
|
type Severity = 'error' | 'warning';
|
package/dist/base.js
CHANGED
package/dist/base.mjs
CHANGED
package/dist/bin/config.js
CHANGED
|
@@ -41,7 +41,7 @@ const filterGadget = (id) => {
|
|
|
41
41
|
const n = Number(id);
|
|
42
42
|
return n < 2300 || n > 2303; // Gadget, Gadget talk, Gadget definition, Gadget definition talk
|
|
43
43
|
};
|
|
44
|
-
const pkg = 'wikilint', version = '
|
|
44
|
+
const pkg = 'wikilint', version = '3.1.0';
|
|
45
45
|
/**
|
|
46
46
|
* Get the parser configuration for a Wikimedia Foundation project.
|
|
47
47
|
* @param site site nickname
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { LintConfiguration } from './lib/lintConfig';
|
|
2
|
-
import { Title } from './lib/title';
|
|
3
2
|
import type { MaxStage, Config, ConfigData, LintError, LintConfig, TokenTypes, Parser as ParserBase } from './base';
|
|
4
|
-
import type { TitleOptions } from './lib/title';
|
|
3
|
+
import type { TitleOptions, Title } from './lib/title';
|
|
5
4
|
import type { LanguageService, QuickFixData } from './lib/lsp';
|
|
6
5
|
import type { Token } from './internal';
|
|
7
6
|
declare interface Parser extends ParserBase {
|
|
@@ -52,7 +51,6 @@ declare interface Parser extends ParserBase {
|
|
|
52
51
|
declare const Parser: Parser;
|
|
53
52
|
// @ts-expect-error mixed export styles
|
|
54
53
|
export = Parser;
|
|
55
|
-
export default Parser;
|
|
56
54
|
export type { Config, ConfigData, LintConfig, LintError, TokenTypes, LanguageService, QuickFixData, Title, };
|
|
57
55
|
export type * from './internal';
|
|
58
56
|
declare global { type WikiParserAcceptable = Record<string, any>; }
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,6 @@ const debug_1 = require("./util/debug");
|
|
|
9
9
|
const constants_1 = require("./util/constants");
|
|
10
10
|
const string_1 = require("./util/string");
|
|
11
11
|
const lintConfig_1 = require("./lib/lintConfig");
|
|
12
|
-
const title_1 = require("./lib/title");
|
|
13
12
|
/* NOT FOR BROWSER ONLY */
|
|
14
13
|
const fs_1 = __importDefault(require("fs"));
|
|
15
14
|
const path_1 = __importDefault(require("path"));
|
|
@@ -139,9 +138,10 @@ const Parser = {
|
|
|
139
138
|
},
|
|
140
139
|
/** @implements */
|
|
141
140
|
normalizeTitle(title, defaultNs = 0, include, config = Parser.getConfig(), opt, accum = []) {
|
|
141
|
+
const { Title: TitleObj } = require('./lib/title');
|
|
142
142
|
let titleObj;
|
|
143
143
|
if (opt?.halfParsed) {
|
|
144
|
-
titleObj = new
|
|
144
|
+
titleObj = new TitleObj(title, defaultNs, config, opt, accum);
|
|
145
145
|
}
|
|
146
146
|
else {
|
|
147
147
|
const { Token } = require('./src/index');
|
|
@@ -150,7 +150,7 @@ const Parser = {
|
|
|
150
150
|
root.type = 'root';
|
|
151
151
|
root.pageName = opt?.page;
|
|
152
152
|
root.parseOnce(0, include).parseOnce();
|
|
153
|
-
const t = new
|
|
153
|
+
const t = new TitleObj(root.firstChild.toString(), defaultNs, config, opt, accum);
|
|
154
154
|
root.build();
|
|
155
155
|
const keys = [
|
|
156
156
|
'main',
|
|
@@ -189,13 +189,11 @@ const Parser = {
|
|
|
189
189
|
config = configOrStage;
|
|
190
190
|
page = pageOrConfig;
|
|
191
191
|
}
|
|
192
|
-
maxStage ??= constants_1.MAX_STAGE;
|
|
192
|
+
maxStage ??= constants_1.MAX_STAGE + 1;
|
|
193
193
|
config ??= this.getConfig();
|
|
194
|
-
// eslint-disable-next-line unicorn/prefer-smaller-scope
|
|
195
|
-
let types;
|
|
196
194
|
LSP: if (typeof maxStage !== 'number') {
|
|
197
|
-
types = Array.isArray(maxStage) ? maxStage : [maxStage];
|
|
198
|
-
maxStage = Math.max(...types.map(t => base_1.stages[t] || constants_1.MAX_STAGE));
|
|
195
|
+
const types = Array.isArray(maxStage) ? maxStage : [maxStage];
|
|
196
|
+
maxStage = Math.max(...types.map(t => base_1.stages[t] || constants_1.MAX_STAGE + 1));
|
|
199
197
|
}
|
|
200
198
|
const { Token } = require('./src/index');
|
|
201
199
|
const root = debug_1.Shadow.run(() => {
|
|
@@ -203,20 +201,29 @@ const Parser = {
|
|
|
203
201
|
token.type = 'root';
|
|
204
202
|
token.pageName = page;
|
|
205
203
|
try {
|
|
206
|
-
|
|
204
|
+
token.parse(maxStage, include);
|
|
205
|
+
PRINT: if (maxStage > constants_1.MAX_STAGE) {
|
|
206
|
+
token.buildLists();
|
|
207
|
+
}
|
|
208
|
+
return token;
|
|
207
209
|
/* NOT FOR BROWSER ONLY */
|
|
208
210
|
}
|
|
209
211
|
catch (e) /* c8 ignore start */ {
|
|
210
212
|
if (e instanceof Error) {
|
|
211
|
-
const file = path_1.default.join(__dirname, '..', 'errors', new Date().toISOString()), stage = token.getAttribute('stage');
|
|
213
|
+
const file = path_1.default.join(__dirname, '..', 'errors', new Date().toISOString()), stage = token.getAttribute('stage'), isMax = stage === constants_1.MAX_STAGE;
|
|
212
214
|
for (const k in config) {
|
|
213
215
|
if (k.startsWith('regex') || config[k] instanceof Set) {
|
|
214
216
|
delete config[k];
|
|
215
217
|
}
|
|
216
218
|
}
|
|
217
|
-
fs_1.default.writeFileSync(file,
|
|
219
|
+
fs_1.default.writeFileSync(file, isMax ? wikitext : token.toString());
|
|
218
220
|
fs_1.default.writeFileSync(`${file}.err`, e.stack);
|
|
219
|
-
fs_1.default.writeFileSync(`${file}.json`, JSON.stringify({
|
|
221
|
+
fs_1.default.writeFileSync(`${file}.json`, JSON.stringify({
|
|
222
|
+
stage: isMax ? maxStage : stage,
|
|
223
|
+
include,
|
|
224
|
+
config,
|
|
225
|
+
page,
|
|
226
|
+
}, null, '\t'));
|
|
220
227
|
}
|
|
221
228
|
throw e;
|
|
222
229
|
}
|
|
@@ -240,7 +247,7 @@ const Parser = {
|
|
|
240
247
|
lint(wikitext, includeOrPage, configOrInclude, pageOrConfig) {
|
|
241
248
|
LINT: {
|
|
242
249
|
const [include, config, page] = getParams(includeOrPage, configOrInclude, pageOrConfig);
|
|
243
|
-
return debug_1.Shadow.internal(() => this.parse(wikitext, include,
|
|
250
|
+
return debug_1.Shadow.internal(() => this.parse(wikitext, include, constants_1.MAX_STAGE, config, page).lint(), this);
|
|
244
251
|
}
|
|
245
252
|
},
|
|
246
253
|
/* NOT FOR BROWSER ONLY */
|
|
@@ -278,5 +285,4 @@ for (const key in Parser) {
|
|
|
278
285
|
}
|
|
279
286
|
}
|
|
280
287
|
Object.defineProperties(Parser, def);
|
|
281
|
-
exports.default = Parser;
|
|
282
288
|
module.exports = Parser;
|
package/dist/internal.d.ts
CHANGED
|
@@ -55,3 +55,4 @@ export type { CommentLineToken } from './src/nowiki/commentLine';
|
|
|
55
55
|
export type { TranslateToken } from './src/tagPair/translate';
|
|
56
56
|
export type { TvarToken } from './src/tag/tvar';
|
|
57
57
|
export type { FuncTagToken } from './src/funcTag';
|
|
58
|
+
export type { ListRangeToken } from './src/nowiki/listBase';
|
package/dist/lib/document.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { TextDocument, Range } from 'vscode-languageserver-textdocument';
|
|
|
3
3
|
import type * as JsonLanguageService from 'vscode-json-languageservice';
|
|
4
4
|
import type * as CssLanguageService from 'vscode-css-languageservice';
|
|
5
5
|
import type * as HtmlLanguageService from 'vscode-html-languageservice';
|
|
6
|
-
import type {
|
|
6
|
+
import type { Warning } from 'stylelint';
|
|
7
7
|
import type { Token } from '../internal';
|
|
8
8
|
export interface TexvcLocation {
|
|
9
9
|
offset: number;
|
|
@@ -31,11 +31,12 @@ declare interface Texvcjs {
|
|
|
31
31
|
usemhchem?: boolean;
|
|
32
32
|
}): TexvcReport;
|
|
33
33
|
}
|
|
34
|
+
declare type StylelintUtil = (code: string) => Promise<Warning[]>;
|
|
34
35
|
export declare const loadTexvcjs: () => Texvcjs | null;
|
|
35
36
|
export declare const loadJsonLSP: () => JsonLanguageService.LanguageService | null;
|
|
36
37
|
export declare const loadCssLSP: () => CssLanguageService.LanguageService | null;
|
|
37
38
|
export declare const loadHtmlData: () => HtmlLanguageService.IHTMLDataProvider | null;
|
|
38
|
-
export declare const loadStylelint: () =>
|
|
39
|
+
export declare const loadStylelint: () => StylelintUtil | null;
|
|
39
40
|
/** embedded document */
|
|
40
41
|
declare abstract class EmbeddedDocument implements TextDocument {
|
|
41
42
|
#private;
|
|
@@ -66,8 +67,8 @@ declare abstract class EmbeddedDocument implements TextDocument {
|
|
|
66
67
|
/** embedded JSON document */
|
|
67
68
|
export declare class EmbeddedJSONDocument extends EmbeddedDocument {
|
|
68
69
|
jsonDoc: JsonLanguageService.JSONDocument;
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
getLineRange: () => Range;
|
|
71
|
+
getEOLCharacters: () => string;
|
|
71
72
|
/**
|
|
72
73
|
* @param root root token
|
|
73
74
|
* @param token current token
|
|
@@ -77,8 +78,8 @@ export declare class EmbeddedJSONDocument extends EmbeddedDocument {
|
|
|
77
78
|
/** embedded CSS document */
|
|
78
79
|
export declare class EmbeddedCSSDocument extends EmbeddedDocument {
|
|
79
80
|
styleSheet: CssLanguageService.Stylesheet;
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
getLineRange: () => Range;
|
|
82
|
+
getEOLCharacters: () => string;
|
|
82
83
|
/**
|
|
83
84
|
* @param root root token
|
|
84
85
|
* @param token current token
|
package/dist/lib/document.js
CHANGED
|
@@ -96,7 +96,9 @@ const loadStylelint = () => {
|
|
|
96
96
|
NPM: {
|
|
97
97
|
if (stylelint === undefined) {
|
|
98
98
|
try {
|
|
99
|
-
stylelint = require('stylelint');
|
|
99
|
+
const stylelintApi = require('stylelint'), { styleLint } = require('@bhsd/stylelint-util');
|
|
100
|
+
const cssRules = { 'block-no-empty': null };
|
|
101
|
+
stylelint = /** @implements */ (code) => styleLint(stylelintApi, code, cssRules);
|
|
100
102
|
}
|
|
101
103
|
catch /* c8 ignore start */ {
|
|
102
104
|
stylelint = null;
|
package/dist/lib/lintConfig.js
CHANGED
package/dist/lib/lsp.js
CHANGED
|
@@ -20,7 +20,6 @@ const path_1 = __importDefault(require("path"));
|
|
|
20
20
|
const util_1 = __importDefault(require("util"));
|
|
21
21
|
const child_process_1 = require("child_process");
|
|
22
22
|
const crypto_1 = require("crypto");
|
|
23
|
-
const stylelint_util_1 = require("@bhsd/stylelint-util");
|
|
24
23
|
const color_1 = require("@bhsd/common/color");
|
|
25
24
|
const search_1 = __importDefault(require("../vendor/search"));
|
|
26
25
|
const constants_2 = require("../util/constants");
|
|
@@ -298,7 +297,7 @@ const partialParse = async (wikitext, watch, include, config = index_1.default.g
|
|
|
298
297
|
};
|
|
299
298
|
/* NOT FOR BROWSER ONLY */
|
|
300
299
|
/** @see https://www.npmjs.com/package/stylelint-config-recommended */
|
|
301
|
-
const
|
|
300
|
+
const colors = Object.keys(color_1.colorsNamed), sources = { 'invalid-css': 'css', 'invalid-math': 'texvc' }, jsonSelector = constants_2.jsonTags.map(s => `ext#${s}`).join(), scores = new Map();
|
|
302
301
|
/**
|
|
303
302
|
* Correct the position of an error.
|
|
304
303
|
* @param height
|
|
@@ -339,6 +338,9 @@ function getStylelintPos(rect, bottom, lineOrCode, columnOrOffset) {
|
|
|
339
338
|
* @param errors LilyPond errors
|
|
340
339
|
*/
|
|
341
340
|
const getLilyPondDiagnostics = (root, token, errors) => {
|
|
341
|
+
if (!errors) {
|
|
342
|
+
return [];
|
|
343
|
+
}
|
|
342
344
|
const { top, left } = root.posFromIndex(token.lastChild.getAbsoluteIndex());
|
|
343
345
|
return errors.map(({ line, col, message }) => {
|
|
344
346
|
const pos = (0, lint_1.getEndPos)(top, left, line, col);
|
|
@@ -877,7 +879,7 @@ class LanguageService {
|
|
|
877
879
|
if (tokens.length === 0) {
|
|
878
880
|
return [];
|
|
879
881
|
}
|
|
880
|
-
const code = tokens.map(({ type, tag, lastChild }, i) => `${type === 'ext-attr' ? 'div' : tag}#${i}{\n${(0, common_1.sanitizeInlineStyle)(lastChild.toString())}\n}`).join('\n'), cssErrors = await (
|
|
882
|
+
const code = tokens.map(({ type, tag, lastChild }, i) => `${type === 'ext-attr' ? 'div' : tag}#${i}{\n${(0, common_1.sanitizeInlineStyle)(lastChild.toString())}\n}`).join('\n'), cssErrors = await stylelint(code);
|
|
881
883
|
if (cssErrors.length === 0) {
|
|
882
884
|
return [];
|
|
883
885
|
}
|
|
@@ -952,7 +954,7 @@ class LanguageService {
|
|
|
952
954
|
try {
|
|
953
955
|
// eslint-disable-next-line @typescript-eslint/strict-void-return
|
|
954
956
|
await util_1.default.promisify(child_process_1.execFile)(this.lilypond, ['-dno-print-pages', '-s', '-o', dir, file]);
|
|
955
|
-
scores.set(score,
|
|
957
|
+
scores.set(score, undefined);
|
|
956
958
|
}
|
|
957
959
|
catch (e) {
|
|
958
960
|
const { stderr } = e;
|
|
@@ -1393,7 +1395,7 @@ class LanguageService {
|
|
|
1393
1395
|
contents: {
|
|
1394
1396
|
kind: 'markdown',
|
|
1395
1397
|
value: (info.signatures
|
|
1396
|
-
? `${info.signatures.map(params => `- **{{ ${f}${params.length === 0 ? '**' : `${colon}** `}${params.map(({ label, const: c }) => c ? label : `*${label}*`).join(' **|** ')} **}}
|
|
1398
|
+
? `${info.signatures.map(params => `- **{{ ${f}${params.length === 0 ? '**' : `${colon}** `}${params.map(({ label, const: c }) => c ? label : `*${label}*`).join(' **|** ')} **}}**\n`).join('')}\n`
|
|
1397
1399
|
: '')
|
|
1398
1400
|
+ info.description,
|
|
1399
1401
|
},
|
|
@@ -1537,7 +1539,7 @@ class LanguageService {
|
|
|
1537
1539
|
* @param diagnostics grammar diagnostics / 语法诊断信息
|
|
1538
1540
|
*/
|
|
1539
1541
|
provideCodeAction(diagnostics) {
|
|
1540
|
-
const actionable = diagnostics.filter((diagnostic) => diagnostic.data), fixable = actionable.filter(({ source, data }) => source === 'WikiLint' && data.some(({ fix }) => fix))
|
|
1542
|
+
const actionable = diagnostics.filter((diagnostic) => diagnostic.data), fixable = actionable.filter(({ source, data }) => source === 'WikiLint' && data.some(({ fix }) => fix));
|
|
1541
1543
|
return [
|
|
1542
1544
|
...actionable.flatMap(diagnostic => diagnostic.data.map((data) => ({
|
|
1543
1545
|
title: data.title,
|
|
@@ -1551,7 +1553,7 @@ class LanguageService {
|
|
|
1551
1553
|
...fixable.length === 0
|
|
1552
1554
|
? []
|
|
1553
1555
|
: [
|
|
1554
|
-
...
|
|
1556
|
+
...[...new Set(fixable.map(({ code }) => code))].map((rule) => ({
|
|
1555
1557
|
title: `Fix all: ${rule}`,
|
|
1556
1558
|
kind: 'source.fixAll',
|
|
1557
1559
|
diagnostics: fixable.filter(({ code }) => code === rule),
|
package/dist/lib/node.d.ts
CHANGED
package/dist/lib/node.js
CHANGED
|
@@ -250,6 +250,14 @@ let AstNode = (() => {
|
|
|
250
250
|
getLines() {
|
|
251
251
|
LINT: return (0, common_1.splitLines)(String(this));
|
|
252
252
|
}
|
|
253
|
+
/** @private */
|
|
254
|
+
removeInternal() {
|
|
255
|
+
PRINT: {
|
|
256
|
+
const { parentNode } = this, i = parentNode?.childNodes.indexOf(this);
|
|
257
|
+
parentNode?.removeAt(i);
|
|
258
|
+
return i;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
253
261
|
};
|
|
254
262
|
return AstNode = _classThis;
|
|
255
263
|
})();
|
package/dist/lib/text.js
CHANGED
|
@@ -95,7 +95,8 @@ class AstText extends node_1.AstNode {
|
|
|
95
95
|
return [];
|
|
96
96
|
}
|
|
97
97
|
errorRegex.lastIndex = 0;
|
|
98
|
-
|
|
98
|
+
let rule = 'tag-like';
|
|
99
|
+
const errors = [], nextType = nextSibling?.type, nextName = nextSibling?.name, previousType = previousSibling?.type, root = this.getRootNode(), rootStr = root.toString(), { ext, html, variants } = root.getAttribute('config'), { top, left } = root.posFromIndex(start), { lintConfig } = index_1.default, tagLike = lintConfig.rules[rule], specified = tagLike[1]
|
|
99
100
|
? new Set(Object.keys(tagLike[1]).filter(tag => tag !== 'invalid' && tag !== 'disallowed'))
|
|
100
101
|
: new Set(), tags = new Set([
|
|
101
102
|
'onlyinclude',
|
|
@@ -106,7 +107,7 @@ class AstText extends node_1.AstNode {
|
|
|
106
107
|
...html[1],
|
|
107
108
|
...html[2],
|
|
108
109
|
...specified,
|
|
109
|
-
...lintConfig.getSeverity(
|
|
110
|
+
...lintConfig.getSeverity(rule, 'disallowed') ? disallowedTags : [],
|
|
110
111
|
]);
|
|
111
112
|
for (let mt = errorRegex.exec(data); mt; mt = errorRegex.exec(data)) {
|
|
112
113
|
let { index, 0: error } = mt;
|
|
@@ -133,7 +134,7 @@ class AstText extends node_1.AstNode {
|
|
|
133
134
|
errorRegex.lastIndex--;
|
|
134
135
|
}
|
|
135
136
|
// Rule & Severity
|
|
136
|
-
let startIndex = start + index, endIndex = startIndex + length,
|
|
137
|
+
let startIndex = start + index, endIndex = startIndex + length, severity;
|
|
137
138
|
const nextChar = rootStr[endIndex], previousChar = rootStr[startIndex - 1], leftBracket = lbrace || lbrack, lConverter = error === '{' && previousChar === '-' && variants.length > 0, rConverter = error === '}' && nextChar === '-' && variants.length > 0, brokenExtLink = lbrack && nextType === 'free-ext-link' && !data.slice(index + 1).trim()
|
|
138
139
|
|| rbrack && previousType === 'free-ext-link' && index === 0;
|
|
139
140
|
if (magicLink) {
|
package/dist/lib/title.js
CHANGED
|
@@ -11,6 +11,7 @@ const resolve = (title) => {
|
|
|
11
11
|
const [, { length }, sub] = /^((?:\.\.\/)*)(.*)/su.exec(title);
|
|
12
12
|
return [length / 3, sub];
|
|
13
13
|
};
|
|
14
|
+
const capitalLinkNs = new Set([-1, 2, 3, 8, 9]);
|
|
14
15
|
/**
|
|
15
16
|
* title object of a MediaWiki page
|
|
16
17
|
*
|
|
@@ -22,6 +23,7 @@ class Title {
|
|
|
22
23
|
#namespaces;
|
|
23
24
|
#path;
|
|
24
25
|
#ns;
|
|
26
|
+
#capitalLinks;
|
|
25
27
|
#fragment;
|
|
26
28
|
/** @private */
|
|
27
29
|
page;
|
|
@@ -42,7 +44,9 @@ class Title {
|
|
|
42
44
|
}
|
|
43
45
|
set main(title) {
|
|
44
46
|
title = title.replace(/_/gu, ' ').trim();
|
|
45
|
-
this.#main =
|
|
47
|
+
this.#main = this.#capitalLinks || capitalLinkNs.has(this.#ns)
|
|
48
|
+
? title && title[0].toUpperCase() + title.slice(1)
|
|
49
|
+
: title;
|
|
46
50
|
}
|
|
47
51
|
/** namespace prefix / 命名空间前缀 */
|
|
48
52
|
get prefix() {
|
|
@@ -129,6 +133,7 @@ class Title {
|
|
|
129
133
|
&& (0, string_1.decodeHtml)(title) === title
|
|
130
134
|
&& (level === 0 || page === undefined || page.split('/', level + 1).length > level)
|
|
131
135
|
&& !/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(sub);
|
|
136
|
+
this.#capitalLinks = config.capitalLinks !== false;
|
|
132
137
|
this.main = title;
|
|
133
138
|
this.#namespaces = config.namespaces;
|
|
134
139
|
this.#path = config.articlePath || '/wiki/$1';
|
package/dist/map.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RedirectToken, RedirectTargetToken, OnlyincludeToken, IncludeToken, CommentToken, ExtToken, AttributesToken, AttributeToken, AtomToken, ArgToken, TranscludeToken, SyntaxToken, ParameterToken, HeadingToken, HtmlToken, TableToken, TrToken, TdToken, DoubleUnderscoreToken, HrToken, LinkToken, CategoryToken, FileToken, ImageParameterToken, QuoteToken, ExtLinkToken, MagicLinkToken, ListToken, DdToken, ConverterToken, ConverterFlagsToken, ConverterRuleToken, TranslateToken, TvarToken, HiddenToken, GalleryImageToken, ParamLineToken, ImagemapLinkToken, CharinsertLineToken } from './internal';
|
|
1
|
+
import type { RedirectToken, RedirectTargetToken, OnlyincludeToken, IncludeToken, CommentToken, ExtToken, AttributesToken, AttributeToken, AtomToken, ArgToken, TranscludeToken, SyntaxToken, ParameterToken, HeadingToken, HtmlToken, TableToken, TrToken, TdToken, DoubleUnderscoreToken, HrToken, LinkToken, CategoryToken, FileToken, ImageParameterToken, QuoteToken, ExtLinkToken, MagicLinkToken, ListToken, DdToken, ConverterToken, ConverterFlagsToken, ConverterRuleToken, TranslateToken, TvarToken, HiddenToken, GalleryImageToken, ParamLineToken, ImagemapLinkToken, CharinsertLineToken, ListRangeToken } from './internal';
|
|
2
2
|
export interface TokenTypeMap {
|
|
3
3
|
redirect: RedirectToken;
|
|
4
4
|
'redirect-syntax': SyntaxToken;
|
|
@@ -64,5 +64,6 @@ export interface TokenTypeMap {
|
|
|
64
64
|
'param-line-value': AtomToken;
|
|
65
65
|
'imagemap-link': ImagemapLinkToken;
|
|
66
66
|
'charinsert-line': CharinsertLineToken;
|
|
67
|
+
'list-range': ListRangeToken;
|
|
67
68
|
}
|
|
68
69
|
export type SelectedTokenTypes = keyof TokenTypeMap;
|
|
@@ -11,7 +11,7 @@ const ext_1 = require("../src/tagPair/ext");
|
|
|
11
11
|
const comment_1 = require("../src/nowiki/comment");
|
|
12
12
|
const onlyincludeLeft = '<onlyinclude>', onlyincludeRight = '</onlyinclude>', getExtRegex = [false, true].map(includeOnly => {
|
|
13
13
|
const noincludeRegex = includeOnly ? 'includeonly' : '(?:no|only)include', includeRegex = includeOnly ? 'noinclude' : 'includeonly';
|
|
14
|
-
return (0, common_1.getRegex)(exts => new RegExp(String.raw `<!--.*?(?:-->|$)|<${noincludeRegex}(?=\s
|
|
14
|
+
return (0, common_1.getRegex)(exts => new RegExp(String.raw `<!--.*?(?:-->|$)|<${noincludeRegex}(?=\s|/?>)|</${noincludeRegex}\s*>|<(${exts})(?=\s|/?>)|<(${includeRegex})(?=\s|/?>)`, 'gisu'));
|
|
15
15
|
});
|
|
16
16
|
/**
|
|
17
17
|
* 解析HTML注释和扩展标签
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseHrAndDoubleUnderscore = void 0;
|
|
4
4
|
const cm_util_1 = require("@bhsd/cm-util");
|
|
5
|
+
const debug_1 = require("../util/debug");
|
|
5
6
|
const hr_1 = require("../src/nowiki/hr");
|
|
6
7
|
const doubleUnderscore_1 = require("../src/nowiki/doubleUnderscore");
|
|
7
8
|
const heading_1 = require("../src/heading");
|
|
@@ -16,7 +17,7 @@ const parseHrAndDoubleUnderscore = ({ firstChild: { data }, type, name }, config
|
|
|
16
17
|
config.insensitiveDoubleUnderscore ??= new Set(insensitive.filter(cm_util_1.isUnderscore));
|
|
17
18
|
config.sensitiveDoubleUnderscore ??= new Set(sensitive.filter(cm_util_1.isUnderscore));
|
|
18
19
|
config.regexHrAndDoubleUnderscore ??= new RegExp(String.raw `^((?:\0\d+[cno]\x7F)*)(-{4,})|__(${all.filter(cm_util_1.isUnderscore).join('|')})__|_{2}(${all.filter(s => !(0, cm_util_1.isUnderscore)(s)).map(s => s.slice(2, -2)).join('|')})_{2}`, 'gimu');
|
|
19
|
-
if (type !== 'root' && (type !== 'ext-inner' ||
|
|
20
|
+
if (type !== 'root' && (type !== 'ext-inner' || !(0, debug_1.isIsolated)(name))) {
|
|
20
21
|
data = `\0${data}`;
|
|
21
22
|
}
|
|
22
23
|
data = data.replace(config.regexHrAndDoubleUnderscore, (m, p1, p2, p3, p4) => {
|
|
@@ -41,6 +42,6 @@ const parseHrAndDoubleUnderscore = ({ firstChild: { data }, type, name }, config
|
|
|
41
42
|
return text;
|
|
42
43
|
});
|
|
43
44
|
}
|
|
44
|
-
return type === 'root' || type === 'ext-inner' && name
|
|
45
|
+
return type === 'root' || type === 'ext-inner' && (0, debug_1.isIsolated)(name) ? data : data.slice(1);
|
|
45
46
|
};
|
|
46
47
|
exports.parseHrAndDoubleUnderscore = parseHrAndDoubleUnderscore;
|
package/dist/parser/table.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseTable = void 0;
|
|
4
|
+
const debug_1 = require("../util/debug");
|
|
4
5
|
const index_1 = require("../src/index");
|
|
5
6
|
const index_2 = require("../src/table/index");
|
|
6
7
|
const tr_1 = require("../src/table/tr");
|
|
@@ -25,7 +26,7 @@ const pop = (top, stack) => top.is('td') ? stack.pop() : top;
|
|
|
25
26
|
*/
|
|
26
27
|
const parseTable = ({ firstChild: { data }, type, name }, config, accum) => {
|
|
27
28
|
const stack = [], lines = data.split('\n');
|
|
28
|
-
let out = type === 'root' || type === 'parameter-value' || type === 'ext-inner' && name
|
|
29
|
+
let out = type === 'root' || type === 'parameter-value' || type === 'ext-inner' && (0, debug_1.isIsolated)(name)
|
|
29
30
|
? ''
|
|
30
31
|
: `\n${lines.shift()}`, top;
|
|
31
32
|
/**
|
package/dist/src/arg.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { Config, LintError } from '../base';
|
|
|
6
6
|
* argument wrapped in `{{{}}}`
|
|
7
7
|
*
|
|
8
8
|
* `{{{}}}`包裹的参数
|
|
9
|
-
* @classdesc `{childNodes: [AtomToken,
|
|
9
|
+
* @classdesc `{childNodes: [AtomToken] | [AtomToken, Token, ...HiddenToken[]]}`
|
|
10
10
|
*/
|
|
11
11
|
export declare abstract class ArgToken extends Token {
|
|
12
12
|
#private;
|
package/dist/src/arg.js
CHANGED
|
@@ -51,7 +51,7 @@ const hidden_1 = require("./hidden");
|
|
|
51
51
|
* argument wrapped in `{{{}}}`
|
|
52
52
|
*
|
|
53
53
|
* `{{{}}}`包裹的参数
|
|
54
|
-
* @classdesc `{childNodes: [AtomToken,
|
|
54
|
+
* @classdesc `{childNodes: [AtomToken] | [AtomToken, Token, ...HiddenToken[]]}`
|
|
55
55
|
*/
|
|
56
56
|
let ArgToken = (() => {
|
|
57
57
|
let _classDecorators = [noEscape_1.noEscape, (0, padded_1.padded)('{{{'), (0, gapped_1.gapped)()];
|
package/dist/src/attributes.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { ExtToken, HtmlToken, SyntaxToken } from '../internal';
|
|
|
7
7
|
import type { AttributeTypes } from './attribute';
|
|
8
8
|
import type { TableTokens } from './table/index';
|
|
9
9
|
declare type AttributesTypes = `${AttributeTypes}s`;
|
|
10
|
+
declare type Child = AtomToken | AttributeToken;
|
|
10
11
|
/**
|
|
11
12
|
* 将属性类型转换为单属性类型
|
|
12
13
|
* @param type 属性类型
|
|
@@ -21,9 +22,9 @@ export declare const toAttributeType: (type: AttributesTypes) => AttributeTypes;
|
|
|
21
22
|
export declare abstract class AttributesToken extends Token {
|
|
22
23
|
#private;
|
|
23
24
|
readonly name: string;
|
|
24
|
-
readonly childNodes: readonly
|
|
25
|
-
abstract get firstChild():
|
|
26
|
-
abstract get lastChild():
|
|
25
|
+
readonly childNodes: readonly Child[];
|
|
26
|
+
abstract get firstChild(): Child | undefined;
|
|
27
|
+
abstract get lastChild(): Child | undefined;
|
|
27
28
|
abstract get parentNode(): ExtToken | HtmlToken | TableTokens | undefined;
|
|
28
29
|
abstract get previousSibling(): SyntaxToken | undefined;
|
|
29
30
|
get type(): AttributesTypes;
|
package/dist/src/converter.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { Config } from '../base';
|
|
|
6
6
|
* language conversion
|
|
7
7
|
*
|
|
8
8
|
* 转换
|
|
9
|
-
* @classdesc `{childNodes: [ConverterFlagsToken, ...ConverterRuleToken[]]}`
|
|
9
|
+
* @classdesc `{childNodes: [ConverterFlagsToken, ConverterRuleToken, ...ConverterRuleToken[]]}`
|
|
10
10
|
*/
|
|
11
11
|
export declare abstract class ConverterToken extends Token {
|
|
12
12
|
readonly childNodes: readonly [ConverterFlagsToken, ConverterRuleToken, ...ConverterRuleToken[]];
|
package/dist/src/converter.js
CHANGED
|
@@ -45,7 +45,7 @@ const converterRule_1 = require("./converterRule");
|
|
|
45
45
|
* language conversion
|
|
46
46
|
*
|
|
47
47
|
* 转换
|
|
48
|
-
* @classdesc `{childNodes: [ConverterFlagsToken, ...ConverterRuleToken[]]}`
|
|
48
|
+
* @classdesc `{childNodes: [ConverterFlagsToken, ConverterRuleToken, ...ConverterRuleToken[]]}`
|
|
49
49
|
*/
|
|
50
50
|
let ConverterToken = (() => {
|
|
51
51
|
let _classDecorators = [noEscape_1.noEscape, (0, padded_1.padded)('-{')];
|
|
@@ -6,7 +6,7 @@ import type { ConverterToken, ConverterFlagsToken } from '../internal';
|
|
|
6
6
|
* language conversion rule
|
|
7
7
|
*
|
|
8
8
|
* 转换规则
|
|
9
|
-
* @classdesc `{childNodes: [Token?, AtomToken
|
|
9
|
+
* @classdesc `{childNodes: [Token] | [Token?, AtomToken, Token]}`
|
|
10
10
|
*/
|
|
11
11
|
export declare abstract class ConverterRuleToken extends Token {
|
|
12
12
|
readonly childNodes: readonly [Token] | readonly [AtomToken, Token] | readonly [Token, AtomToken, Token];
|