wikiparser-node 1.28.0 → 1.28.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.
- package/bundle/bundle-es8.min.js +24 -24
- package/bundle/bundle-lsp.min.js +28 -28
- package/bundle/bundle.min.js +22 -22
- package/config/default.json +15 -16
- package/config/jawiki.json +15 -16
- package/dist/base.d.mts +1 -1
- package/dist/base.d.ts +1 -1
- package/dist/base.js +1 -0
- package/dist/base.mjs +1 -0
- package/dist/bin/config.js +11 -11
- package/dist/lib/lintConfig.js +2 -0
- package/dist/lib/lsp.js +4 -1
- package/dist/parser/commentAndExt.js +4 -1
- package/dist/parser/hrAndDoubleUnderscore.js +9 -8
- package/dist/src/arg.js +2 -3
- package/dist/src/attribute.js +1 -0
- package/dist/src/imageParameter.js +49 -19
- package/dist/src/link/file.js +1 -4
- package/dist/src/magicLink.js +12 -1
- package/dist/src/nowiki/doubleUnderscore.d.ts +2 -1
- package/dist/src/nowiki/doubleUnderscore.js +10 -4
- package/dist/src/tagPair/ext.js +10 -3
- package/extensions/dist/base.js +1 -1
- package/i18n/en.json +2 -0
- package/i18n/zh-hans.json +2 -0
- package/i18n/zh-hant.json +2 -0
- package/package.json +4 -4
|
@@ -13,7 +13,8 @@ export declare abstract class DoubleUnderscoreToken extends NowikiBaseToken {
|
|
|
13
13
|
/**
|
|
14
14
|
* @param word 状态开关名
|
|
15
15
|
* @param sensitive 是否固定大小写
|
|
16
|
+
* @param fullWidth 是否为全角下划线
|
|
16
17
|
*/
|
|
17
|
-
constructor(word: string, sensitive: boolean, config: Config, accum?: Token[]);
|
|
18
|
+
constructor(word: string, sensitive: boolean, fullWidth: boolean, config: Config, accum?: Token[]);
|
|
18
19
|
cloneNode(): this;
|
|
19
20
|
}
|
|
@@ -63,6 +63,7 @@ let DoubleUnderscoreToken = (() => {
|
|
|
63
63
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
64
64
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
65
65
|
}
|
|
66
|
+
#fullWidth;
|
|
66
67
|
/* NOT FOR BROWSER */
|
|
67
68
|
#sensitive;
|
|
68
69
|
/* NOT FOR BROWSER END */
|
|
@@ -72,28 +73,33 @@ let DoubleUnderscoreToken = (() => {
|
|
|
72
73
|
/**
|
|
73
74
|
* @param word 状态开关名
|
|
74
75
|
* @param sensitive 是否固定大小写
|
|
76
|
+
* @param fullWidth 是否为全角下划线
|
|
75
77
|
*/
|
|
76
|
-
constructor(word, sensitive, config, accum) {
|
|
78
|
+
constructor(word, sensitive, fullWidth, config, accum) {
|
|
77
79
|
super(word, config, accum);
|
|
78
80
|
const lc = word.toLowerCase(), { doubleUnderscore: [, , iAlias, sAlias] } = config;
|
|
79
81
|
this.setAttribute('name', (sensitive ? sAlias?.[word]?.toLowerCase() : iAlias?.[lc]) ?? lc);
|
|
82
|
+
this.#fullWidth = fullWidth;
|
|
80
83
|
/* NOT FOR BROWSER */
|
|
81
84
|
this.#sensitive = sensitive;
|
|
82
85
|
this.setAttribute('pattern', new RegExp(`^${word}$`, sensitive ? 'u' : 'iu'));
|
|
83
86
|
}
|
|
84
87
|
/** @private */
|
|
85
88
|
toString() {
|
|
86
|
-
|
|
89
|
+
const underscore = this.#fullWidth ? '__' : '__';
|
|
90
|
+
return underscore + this.innerText + underscore;
|
|
87
91
|
}
|
|
88
92
|
/** @private */
|
|
89
93
|
print() {
|
|
90
|
-
|
|
94
|
+
const underscore = this.#fullWidth ? '__' : '__';
|
|
95
|
+
return super.print({ pre: underscore, post: underscore });
|
|
91
96
|
}
|
|
92
97
|
/* NOT FOR BROWSER */
|
|
93
98
|
cloneNode() {
|
|
94
99
|
const config = this.getAttribute('config');
|
|
100
|
+
return debug_1.Shadow.run(
|
|
95
101
|
// @ts-expect-error abstract class
|
|
96
|
-
|
|
102
|
+
() => new DoubleUnderscoreToken(this.innerText, this.#sensitive, this.#fullWidth, config));
|
|
97
103
|
}
|
|
98
104
|
};
|
|
99
105
|
return DoubleUnderscoreToken = _classThis;
|
package/dist/src/tagPair/ext.js
CHANGED
|
@@ -206,9 +206,16 @@ let ExtToken = (() => {
|
|
|
206
206
|
errors.push((0, lint_1.generateForSelf)(this, rect, rule, 'ext-in-html', severity));
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
209
|
+
if (this.name === 'ref') {
|
|
210
|
+
let rule = 'var-anchor', s = lintConfig.getSeverity(rule, 'ref');
|
|
211
|
+
if (s && this.closest('heading-title')) {
|
|
212
|
+
errors.push((0, lint_1.generateForSelf)(this, rect, rule, 'variable-anchor', s));
|
|
213
|
+
}
|
|
214
|
+
rule = 'nested-link';
|
|
215
|
+
s = lintConfig.getSeverity(rule, 'ref');
|
|
216
|
+
if (s && this.closest('link,ext-link-text')) {
|
|
217
|
+
errors.push((0, lint_1.generateForSelf)(this, rect, rule, 'ref-in-link', s));
|
|
218
|
+
}
|
|
212
219
|
}
|
|
213
220
|
return errors;
|
|
214
221
|
}
|
package/extensions/dist/base.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
var _a;
|
|
3
|
-
const version = '1.28.
|
|
3
|
+
const version = '1.28.1', src = (_a = document.currentScript) === null || _a === void 0 ? void 0 : _a.src, file = /\/extensions\/dist\/base\.(?:min\.)?js$/u, CDN = src && file.test(src)
|
|
4
4
|
? src.replace(file, '')
|
|
5
5
|
: `https://testingcf.jsdelivr.net/npm/wikiparser-node@${version}`;
|
|
6
6
|
const workerJS = () => {
|
package/i18n/en.json
CHANGED
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"invalid-isbn": "invalid ISBN",
|
|
40
40
|
"invalid-parameter": "invalid parameter of <$1>",
|
|
41
41
|
"invalid-self-closing": "invalid self-closing tag",
|
|
42
|
+
"invalid-url": "invalid URL",
|
|
42
43
|
"invisible-triple-braces": "invisible content inside triple braces",
|
|
43
44
|
"italic-apostrophes": "italic apostrophes",
|
|
44
45
|
"left-bracket": "opening bracket",
|
|
@@ -56,6 +57,7 @@
|
|
|
56
57
|
"prefix": null,
|
|
57
58
|
"pipe-in-link": "additional \"|\" in the link text",
|
|
58
59
|
"pipe-in-table": "additional \"|\" in a table cell",
|
|
60
|
+
"ref-in-link": "<ref> in an internal or external link",
|
|
59
61
|
"remove": null,
|
|
60
62
|
"template-in-link": "template in an internal link target",
|
|
61
63
|
"unbalanced-in-section-header": "unbalanced $1 in a section header",
|
package/i18n/zh-hans.json
CHANGED
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"invalid-isbn": "无效的ISBN",
|
|
40
40
|
"invalid-parameter": "<$1>的无效参数",
|
|
41
41
|
"invalid-self-closing": "无效自封闭标签",
|
|
42
|
+
"invalid-url": "无效的URL",
|
|
42
43
|
"invisible-triple-braces": "三重括号内的不可见部分",
|
|
43
44
|
"italic-apostrophes": "斜体单引号",
|
|
44
45
|
"left-bracket": "左括号",
|
|
@@ -56,6 +57,7 @@
|
|
|
56
57
|
"prefix": "前缀",
|
|
57
58
|
"pipe-in-link": "链接文本中多余的\"|\"",
|
|
58
59
|
"pipe-in-table": "表格单元格中多余的\"|\"",
|
|
60
|
+
"ref-in-link": "内链或外链中的<ref>",
|
|
59
61
|
"remove": "移除",
|
|
60
62
|
"template-in-link": "内链目标包含模板",
|
|
61
63
|
"unbalanced-in-section-header": "章节标题中未成对的$1",
|
package/i18n/zh-hant.json
CHANGED
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"invalid-isbn": "無效的ISBN",
|
|
40
40
|
"invalid-parameter": "<$1>的無效參數",
|
|
41
41
|
"invalid-self-closing": "無效自封閉標籤",
|
|
42
|
+
"invalid-url": "無效的URL",
|
|
42
43
|
"invisible-triple-braces": "三重括號內的不可見部分",
|
|
43
44
|
"italic-apostrophes": "斜體撇號",
|
|
44
45
|
"left-bracket": "左括號",
|
|
@@ -56,6 +57,7 @@
|
|
|
56
57
|
"prefix": "前綴",
|
|
57
58
|
"pipe-in-link": "連結文本中多餘的\"|\"",
|
|
58
59
|
"pipe-in-table": "表格儲存格中多餘的\"|\"",
|
|
60
|
+
"ref-in-link": "內部或外部連結裡的<ref>",
|
|
59
61
|
"remove": "移除",
|
|
60
62
|
"template-in-link": "內部連結目標包含模板",
|
|
61
63
|
"unbalanced-in-section-header": "章節標題裡未成對的$1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wikiparser-node",
|
|
3
|
-
"version": "1.28.
|
|
3
|
+
"version": "1.28.1",
|
|
4
4
|
"description": "A Node.js parser for MediaWiki markup with AST",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mediawiki",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
]
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@bhsd/cm-util": "^0.0
|
|
79
|
+
"@bhsd/cm-util": "^0.1.0",
|
|
80
80
|
"@bhsd/common": "^1.0.1",
|
|
81
81
|
"@bhsd/stylelint-util": "^0.1.0",
|
|
82
82
|
"vscode-languageserver-types": "^3.17.5"
|
|
@@ -86,13 +86,13 @@
|
|
|
86
86
|
"color-name": "^2.0.0",
|
|
87
87
|
"entities": "^6.0.0",
|
|
88
88
|
"mathjax": "^3.2.2",
|
|
89
|
-
"stylelint": "^16.
|
|
89
|
+
"stylelint": "^16.25.0",
|
|
90
90
|
"vscode-css-languageservice": "^6.3.7",
|
|
91
91
|
"vscode-html-languageservice": "^5.5.1",
|
|
92
92
|
"vscode-json-languageservice": "^5.6.1"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
|
-
"@bhsd/code-standard": "^1.
|
|
95
|
+
"@bhsd/code-standard": "^1.2.0",
|
|
96
96
|
"@bhsd/test-util": "^0.1.0",
|
|
97
97
|
"@codemirror/lint": "^6.8.5",
|
|
98
98
|
"@stylistic/eslint-plugin": "^3.1.0",
|