wikilint 2.13.3 → 2.13.4
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/config/default.json +1 -1
- package/config/zhwiki.json +1 -1
- package/dist/src/transclude.js +1 -1
- package/dist/util/sharable.d.ts +1 -0
- package/dist/util/string.js +3 -7
- package/package.json +2 -2
package/config/default.json
CHANGED
|
@@ -383,7 +383,6 @@
|
|
|
383
383
|
"#匹配式": "ifeq",
|
|
384
384
|
"#若相等": "ifeq",
|
|
385
385
|
"#如果相等": "ifeq",
|
|
386
|
-
"#若表達式": "ifeq",
|
|
387
386
|
"#ifeq": "ifeq",
|
|
388
387
|
"#多选式": "switch",
|
|
389
388
|
"#多条件式": "switch",
|
|
@@ -397,6 +396,7 @@
|
|
|
397
396
|
"#如有": "ifexist",
|
|
398
397
|
"#ifexist": "ifexist",
|
|
399
398
|
"#若表达式": "ifexpr",
|
|
399
|
+
"#若表達式": "ifexpr",
|
|
400
400
|
"#ifexpr": "ifexpr",
|
|
401
401
|
"#错误式": "iferror",
|
|
402
402
|
"#如果错误": "iferror",
|
package/config/zhwiki.json
CHANGED
|
@@ -364,7 +364,6 @@
|
|
|
364
364
|
"#匹配式": "ifeq",
|
|
365
365
|
"#若相等": "ifeq",
|
|
366
366
|
"#如果相等": "ifeq",
|
|
367
|
-
"#若表達式": "ifeq",
|
|
368
367
|
"#ifeq": "ifeq",
|
|
369
368
|
"#多选式": "switch",
|
|
370
369
|
"#多条件式": "switch",
|
|
@@ -378,6 +377,7 @@
|
|
|
378
377
|
"#如有": "ifexist",
|
|
379
378
|
"#ifexist": "ifexist",
|
|
380
379
|
"#若表达式": "ifexpr",
|
|
380
|
+
"#若表達式": "ifexpr",
|
|
381
381
|
"#ifexpr": "ifexpr",
|
|
382
382
|
"#错误式": "iferror",
|
|
383
383
|
"#如果错误": "iferror",
|
package/dist/src/transclude.js
CHANGED
|
@@ -59,7 +59,7 @@ class TranscludeToken extends index_2.Token {
|
|
|
59
59
|
if (isFunction || parts.length === 0 && !this.#raw) {
|
|
60
60
|
const [magicWord, ...arg] = title.split(':'), cleaned = (0, string_1.removeComment)(magicWord), name = cleaned[arg.length > 0 ? 'trimStart' : 'trim'](), lcName = name.toLowerCase(), canonicalName = Object.prototype.hasOwnProperty.call(insensitive, lcName) && insensitive[lcName], isSensitive = sensitive.includes(name), isVar = isSensitive || insensitiveVars.has(canonicalName);
|
|
61
61
|
if (isVar || isFunction && canonicalName) {
|
|
62
|
-
this.setAttribute('name', canonicalName || lcName);
|
|
62
|
+
this.setAttribute('name', canonicalName || lcName.replace(/^#/u, ''));
|
|
63
63
|
this.#type = 'magic-word';
|
|
64
64
|
const pattern = new RegExp(String.raw `^\s*${name}\s*$`, isSensitive ? 'u' : 'iu'), token = new syntax_1.SyntaxToken(magicWord, pattern, 'magic-word-name', config, accum, {});
|
|
65
65
|
super.insertAt(token);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const commonHtmlAttrs: Set<string>, htmlAttrs: Record<string, Set<string>>, extAttrs: Record<string, Set<string>>, obsoleteAttrs: Record<string, Set<string>>;
|
package/dist/util/string.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.noWrap = exports.decodeNumber = exports.decodeHtml = exports.text = exports.
|
|
3
|
+
exports.noWrap = exports.decodeNumber = exports.decodeHtml = exports.text = exports.escapeRegExp = exports.removeComment = exports.tidy = exports.extUrlChar = exports.extUrlCharFirst = exports.rawurldecode = void 0;
|
|
4
|
+
var common_1 = require("@bhsd/common");
|
|
5
|
+
Object.defineProperty(exports, "rawurldecode", { enumerable: true, get: function () { return common_1.rawurldecode; } });
|
|
4
6
|
const commonExtUrlChar = String.raw `[^[\]<>"\0-\x1F\x7F\p{Zs}\uFFFD]`;
|
|
5
7
|
exports.extUrlCharFirst = String.raw `(?:\[[\da-f:.]+\]|${commonExtUrlChar})`;
|
|
6
8
|
exports.extUrlChar = String.raw `(?:${commonExtUrlChar}|\0\d+[cn!~]\x7F)*`;
|
|
@@ -16,12 +18,6 @@ exports.tidy = factory(/[\0\x7F]|\r$/gmu, '');
|
|
|
16
18
|
exports.removeComment = factory(/\0\d+[cn]\x7F/gu, '');
|
|
17
19
|
/** escape special chars for RegExp constructor */
|
|
18
20
|
exports.escapeRegExp = factory(/[\\{}()|.?*+^$[\]]/gu, String.raw `\$&`);
|
|
19
|
-
/**
|
|
20
|
-
* PHP的`rawurldecode`函数的JavaScript实现
|
|
21
|
-
* @param str 要解码的字符串
|
|
22
|
-
*/
|
|
23
|
-
const rawurldecode = (str) => decodeURIComponent(str.replace(/%(?![\da-f]{2})/giu, '%25'));
|
|
24
|
-
exports.rawurldecode = rawurldecode;
|
|
25
21
|
/**
|
|
26
22
|
* extract effective wikitext
|
|
27
23
|
* @param childNodes a Token's contents
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wikilint",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.4",
|
|
4
4
|
"description": "A Node.js linter for MediaWiki markup",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mediawiki",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"chalk": "^4.1.2"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@bhsd/common": "^0.4.
|
|
54
|
+
"@bhsd/common": "^0.4.3",
|
|
55
55
|
"@types/node": "^22.9.0",
|
|
56
56
|
"v8r": "^3.0.0"
|
|
57
57
|
},
|