wikiparser-node 1.3.8 → 1.3.9
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/dist/base.d.ts +7 -1
- package/dist/index.js +4 -2
- package/dist/lib/title.js +2 -2
- package/dist/parser/braces.js +1 -1
- package/dist/src/attribute.js +28 -5
- package/dist/src/heading.d.ts +1 -1
- package/dist/src/heading.js +16 -7
- package/dist/src/html.js +36 -2
- package/dist/src/link/base.js +4 -0
- package/dist/src/nowiki/quote.d.ts +6 -0
- package/dist/src/nowiki/quote.js +16 -0
- package/dist/src/transclude.js +3 -2
- package/i18n/zh-hans.json +6 -1
- package/i18n/zh-hant.json +6 -1
- package/package.json +2 -1
package/dist/base.d.ts
CHANGED
|
@@ -33,6 +33,11 @@ export interface AstNode {
|
|
|
33
33
|
/** 以HTML格式打印 */
|
|
34
34
|
print(): string;
|
|
35
35
|
}
|
|
36
|
+
/** 类似HTMLElement */
|
|
37
|
+
interface AstElement extends AstNode {
|
|
38
|
+
/** 保存为JSON */
|
|
39
|
+
json(): object;
|
|
40
|
+
}
|
|
36
41
|
export interface Parser {
|
|
37
42
|
config: string | Config;
|
|
38
43
|
i18n: string | Record<string, string> | undefined;
|
|
@@ -41,5 +46,6 @@ export interface Parser {
|
|
|
41
46
|
* @param include 是否嵌入
|
|
42
47
|
* @param maxStage 最大解析层级
|
|
43
48
|
*/
|
|
44
|
-
parse(wikitext: string, include?: boolean, maxStage?: number, config?: Config):
|
|
49
|
+
parse(wikitext: string, include?: boolean, maxStage?: number, config?: Config): AstElement;
|
|
45
50
|
}
|
|
51
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -162,8 +162,10 @@ const Parser = {
|
|
|
162
162
|
},
|
|
163
163
|
/** @implements */
|
|
164
164
|
isInterwiki(title, { interwiki } = Parser.getConfig()) {
|
|
165
|
-
return
|
|
166
|
-
|
|
165
|
+
return interwiki.length > 0
|
|
166
|
+
? new RegExp(`^(${interwiki.join('|')})\\s*:`, 'diu')
|
|
167
|
+
.exec(title.replace(/_/gu, ' ').replace(/^\s*:?\s*/u, ''))
|
|
168
|
+
: null;
|
|
167
169
|
},
|
|
168
170
|
/** @implements */
|
|
169
171
|
reparse(date) {
|
package/dist/lib/title.js
CHANGED
|
@@ -86,7 +86,7 @@ class Title {
|
|
|
86
86
|
const m = title.split(':');
|
|
87
87
|
if (m.length > 1) {
|
|
88
88
|
const id = nsid[m[0].trim().toLowerCase()];
|
|
89
|
-
if (id
|
|
89
|
+
if (id) {
|
|
90
90
|
ns = id;
|
|
91
91
|
title = m.slice(1).join(':').trim();
|
|
92
92
|
}
|
|
@@ -112,7 +112,7 @@ class Title {
|
|
|
112
112
|
}
|
|
113
113
|
this.valid = Boolean(title
|
|
114
114
|
|| this.interwiki
|
|
115
|
-
|| selfLink && this.fragment !== undefined) &&
|
|
115
|
+
|| selfLink && this.fragment !== undefined) && !/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|]|%[\da-f]{2}/iu.test(title);
|
|
116
116
|
this.main = title;
|
|
117
117
|
Object.defineProperties(this, {
|
|
118
118
|
valid: { writable: false },
|
package/dist/parser/braces.js
CHANGED
|
@@ -85,7 +85,7 @@ const parseBraces = (wikitext, config = Parser.getConfig(), accum = []) => {
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
catch (e) {
|
|
88
|
-
if (e instanceof SyntaxError && e.message
|
|
88
|
+
if (e instanceof SyntaxError && e.message === '非法的模板名称') {
|
|
89
89
|
skip = true;
|
|
90
90
|
}
|
|
91
91
|
else {
|
package/dist/src/attribute.js
CHANGED
|
@@ -35,7 +35,7 @@ const commonHtmlAttrs = new Set([
|
|
|
35
35
|
'itemref',
|
|
36
36
|
'itemscope',
|
|
37
37
|
'itemtype',
|
|
38
|
-
]), blockAttrs = new Set(['align']), citeAttrs = new Set(['cite']), citeAndAttrs = new Set(['cite', 'datetime']), widthAttrs = new Set(['width']),
|
|
38
|
+
]), blockAttrs = new Set(['align']), citeAttrs = new Set(['cite']), citeAndAttrs = new Set(['cite', 'datetime']), widthAttrs = new Set(['width']), obsoleteTdAttrs = new Set(['axis', 'align', 'bgcolor', 'height', 'width', 'valign']), tdAttrs = new Set([...obsoleteTdAttrs, 'abbr', 'headers', 'scope', 'rowspan', 'colspan']), typeAttrs = new Set(['type']), obsoleteTableAttrs = new Set(['summary', 'align', 'bgcolor', 'cellpadding', 'cellspacing', 'frame', 'rules', 'width']), brAttrs = new Set(['clear']), trAttrs = new Set(['bgcolor', 'align', 'valign']), htmlAttrs = {
|
|
39
39
|
div: blockAttrs,
|
|
40
40
|
h1: blockAttrs,
|
|
41
41
|
h2: blockAttrs,
|
|
@@ -46,16 +46,16 @@ const commonHtmlAttrs = new Set([
|
|
|
46
46
|
blockquote: citeAttrs,
|
|
47
47
|
q: citeAttrs,
|
|
48
48
|
p: blockAttrs,
|
|
49
|
-
br:
|
|
49
|
+
br: brAttrs,
|
|
50
50
|
pre: widthAttrs,
|
|
51
51
|
ins: citeAndAttrs,
|
|
52
52
|
del: citeAndAttrs,
|
|
53
53
|
ul: typeAttrs,
|
|
54
54
|
ol: new Set(['type', 'start', 'reversed']),
|
|
55
55
|
li: new Set(['type', 'value']),
|
|
56
|
-
table: new Set([
|
|
56
|
+
table: new Set([...obsoleteTableAttrs, 'border']),
|
|
57
57
|
caption: blockAttrs,
|
|
58
|
-
tr:
|
|
58
|
+
tr: trAttrs,
|
|
59
59
|
td: tdAttrs,
|
|
60
60
|
th: tdAttrs,
|
|
61
61
|
img: new Set(['alt', 'src', 'width', 'height', 'srcset']),
|
|
@@ -152,7 +152,26 @@ const commonHtmlAttrs = new Set([
|
|
|
152
152
|
+ '|'
|
|
153
153
|
+ '(?:url|image(?:-set)?)\\s*\\('
|
|
154
154
|
+ '|'
|
|
155
|
-
+ 'attr\\s*\\([^)]+[\\s,]url', 'u')
|
|
155
|
+
+ 'attr\\s*\\([^)]+[\\s,]url', 'u'), obsoleteAttrs = {
|
|
156
|
+
table: obsoleteTableAttrs,
|
|
157
|
+
td: new Set([...obsoleteTdAttrs, 'scope']),
|
|
158
|
+
th: obsoleteTdAttrs,
|
|
159
|
+
br: brAttrs,
|
|
160
|
+
caption: blockAttrs,
|
|
161
|
+
div: blockAttrs,
|
|
162
|
+
hr: widthAttrs,
|
|
163
|
+
h1: blockAttrs,
|
|
164
|
+
h2: blockAttrs,
|
|
165
|
+
h3: blockAttrs,
|
|
166
|
+
h4: blockAttrs,
|
|
167
|
+
h5: blockAttrs,
|
|
168
|
+
h6: blockAttrs,
|
|
169
|
+
li: typeAttrs,
|
|
170
|
+
p: blockAttrs,
|
|
171
|
+
pre: widthAttrs,
|
|
172
|
+
tr: trAttrs,
|
|
173
|
+
ul: typeAttrs,
|
|
174
|
+
};
|
|
156
175
|
/**
|
|
157
176
|
* 扩展和HTML标签属性
|
|
158
177
|
* @classdesc `{childNodes: [AtomToken, Token|AtomToken]}`
|
|
@@ -293,6 +312,10 @@ class AttributeToken extends (0, fixed_1.fixed)(index_1.Token) {
|
|
|
293
312
|
rect ??= { start, ...this.getRootNode().posFromIndex(start) };
|
|
294
313
|
errors.push((0, lint_1.generateForChild)(firstChild, rect, 'illegal attribute name'));
|
|
295
314
|
}
|
|
315
|
+
else if (obsoleteAttrs[tag]?.has(name)) {
|
|
316
|
+
rect ??= { start, ...this.getRootNode().posFromIndex(start) };
|
|
317
|
+
errors.push((0, lint_1.generateForChild)(firstChild, rect, 'obsolete attribute', 'warning'));
|
|
318
|
+
}
|
|
296
319
|
else if (name === 'style' && typeof value === 'string' && insecureStyle.test(value)) {
|
|
297
320
|
rect ??= { start, ...this.getRootNode().posFromIndex(start) };
|
|
298
321
|
errors.push((0, lint_1.generateForChild)(lastChild, rect, 'insecure style'));
|
package/dist/src/heading.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { LintError } from '../base';
|
|
|
5
5
|
declare const HeadingToken_base: (abstract new (...args: any[]) => {
|
|
6
6
|
prependNewLine(): string;
|
|
7
7
|
toString(omit?: Set<string> | undefined): string;
|
|
8
|
-
getAttribute<S extends string>(key: S): TokenAttributeGetter<S>;
|
|
8
|
+
getAttribute<S extends string>(key: S): TokenAttributeGetter<S>; /** 标题格式的等号 */
|
|
9
9
|
text(): string;
|
|
10
10
|
readonly length: number;
|
|
11
11
|
lint(start?: number | undefined): Parser.LintError[];
|
package/dist/src/heading.js
CHANGED
|
@@ -80,18 +80,27 @@ class HeadingToken extends (0, sol_1.sol)((0, fixed_1.fixed)(index_1.Token)) {
|
|
|
80
80
|
}
|
|
81
81
|
/** @override */
|
|
82
82
|
lint(start = this.getAbsoluteIndex()) {
|
|
83
|
-
const errors = super.lint(start), { firstChild } = this, innerStr = String(firstChild);
|
|
84
|
-
let
|
|
83
|
+
const errors = super.lint(start), { firstChild, level } = this, innerStr = String(firstChild), quotes = firstChild.childNodes.filter((node) => node.type === 'quote'), boldQuotes = quotes.filter(({ bold }) => bold), italicQuotes = quotes.filter(({ italic }) => italic);
|
|
84
|
+
let rect;
|
|
85
85
|
if (this.level === 1) {
|
|
86
|
-
|
|
87
|
-
errors.push(
|
|
86
|
+
rect = { start, ...this.getRootNode().posFromIndex(start) };
|
|
87
|
+
errors.push((0, lint_1.generateForChild)(firstChild, rect, '<h1>'));
|
|
88
88
|
}
|
|
89
89
|
if (innerStr.startsWith('=') || innerStr.endsWith('=')) {
|
|
90
|
-
|
|
91
|
-
errors.push(
|
|
90
|
+
rect ??= { start, ...this.getRootNode().posFromIndex(start) };
|
|
91
|
+
errors.push((0, lint_1.generateForChild)(firstChild, rect, Parser.msg('unbalanced $1 in a section header', '"="')));
|
|
92
92
|
}
|
|
93
93
|
if (this.closest('html-attrs, table-attrs')) {
|
|
94
|
-
|
|
94
|
+
rect ??= { start, ...this.getRootNode().posFromIndex(start) };
|
|
95
|
+
errors.push((0, lint_1.generateForSelf)(this, rect, 'section header in a HTML tag'));
|
|
96
|
+
}
|
|
97
|
+
if (boldQuotes.length % 2) {
|
|
98
|
+
rect ??= { start, ...this.getRootNode().posFromIndex(start) };
|
|
99
|
+
errors.push((0, lint_1.generateForChild)(boldQuotes[boldQuotes.length - 1], { ...rect, start: start + level, left: rect.left + level }, Parser.msg('unbalanced $1 in a section header', 'bold apostrophes')));
|
|
100
|
+
}
|
|
101
|
+
if (italicQuotes.length % 2) {
|
|
102
|
+
rect ??= { start, ...this.getRootNode().posFromIndex(start) };
|
|
103
|
+
errors.push((0, lint_1.generateForChild)(italicQuotes[italicQuotes.length - 1], { start: start + level }, Parser.msg('unbalanced $1 in a section header', 'italic apostrophes')));
|
|
95
104
|
}
|
|
96
105
|
return errors;
|
|
97
106
|
}
|
package/dist/src/html.js
CHANGED
|
@@ -9,7 +9,33 @@ const fixed_1 = require("../mixin/fixed");
|
|
|
9
9
|
const attributesParent_1 = require("../mixin/attributesParent");
|
|
10
10
|
const Parser = require("../index");
|
|
11
11
|
const index_1 = require("./index");
|
|
12
|
-
const magicWords = new Set(['if', 'ifeq', 'ifexpr', 'ifexist', 'iferror', 'switch'])
|
|
12
|
+
const magicWords = new Set(['if', 'ifeq', 'ifexpr', 'ifexist', 'iferror', 'switch']), formattingTags = new Set([
|
|
13
|
+
'b',
|
|
14
|
+
'big',
|
|
15
|
+
'center',
|
|
16
|
+
'cite',
|
|
17
|
+
'code',
|
|
18
|
+
'del',
|
|
19
|
+
'dfn',
|
|
20
|
+
'em',
|
|
21
|
+
'font',
|
|
22
|
+
'i',
|
|
23
|
+
'ins',
|
|
24
|
+
'kbd',
|
|
25
|
+
'mark',
|
|
26
|
+
'pre',
|
|
27
|
+
'q',
|
|
28
|
+
's',
|
|
29
|
+
'samp',
|
|
30
|
+
'small',
|
|
31
|
+
'strike',
|
|
32
|
+
'strong',
|
|
33
|
+
'sub',
|
|
34
|
+
'sup',
|
|
35
|
+
'tt',
|
|
36
|
+
'u',
|
|
37
|
+
'var',
|
|
38
|
+
]), obsoleteTags = new Set(['strike', 'big', 'center', 'font', 'tt']);
|
|
13
39
|
/**
|
|
14
40
|
* HTML标签
|
|
15
41
|
* @classdesc `{childNodes: [AttributesToken]}`
|
|
@@ -119,7 +145,7 @@ class HtmlToken extends (0, attributesParent_1.attributesParent)((0, fixed_1.fix
|
|
|
119
145
|
const { message: errorMsg } = e;
|
|
120
146
|
refError ??= (0, lint_1.generateForSelf)(this, { start }, '');
|
|
121
147
|
const [msg] = errorMsg.split(':'), error = { ...refError, message: Parser.msg(msg) };
|
|
122
|
-
if (msg === 'unclosed tag') {
|
|
148
|
+
if (msg === 'unclosed tag' && !formattingTags.has(this.name)) {
|
|
123
149
|
error.severity = 'warning';
|
|
124
150
|
}
|
|
125
151
|
else if (msg === 'unmatched closing tag') {
|
|
@@ -131,6 +157,14 @@ class HtmlToken extends (0, attributesParent_1.attributesParent)((0, fixed_1.fix
|
|
|
131
157
|
errors.push(error);
|
|
132
158
|
}
|
|
133
159
|
}
|
|
160
|
+
if (obsoleteTags.has(this.name)) {
|
|
161
|
+
refError ??= (0, lint_1.generateForSelf)(this, { start }, '');
|
|
162
|
+
errors.push({
|
|
163
|
+
...refError,
|
|
164
|
+
message: Parser.msg('obsolete HTML tag'),
|
|
165
|
+
severity: 'warning',
|
|
166
|
+
});
|
|
167
|
+
}
|
|
134
168
|
return errors;
|
|
135
169
|
}
|
|
136
170
|
/**
|
package/dist/src/link/base.js
CHANGED
|
@@ -150,6 +150,10 @@ class LinkBaseToken extends index_1.Token {
|
|
|
150
150
|
rect ??= { start, ...this.getRootNode().posFromIndex(start) };
|
|
151
151
|
errors.push((0, lint_1.generateForChild)(target, rect, 'useless fragment'));
|
|
152
152
|
}
|
|
153
|
+
if (linkType === 'link' && this.closest('ext-link-text')) {
|
|
154
|
+
rect ??= { start, ...this.getRootNode().posFromIndex(start) };
|
|
155
|
+
errors.push((0, lint_1.generateForSelf)(this, rect, 'internal link in an external link'));
|
|
156
|
+
}
|
|
153
157
|
return errors;
|
|
154
158
|
}
|
|
155
159
|
/** @private */
|
|
@@ -18,7 +18,13 @@ declare const QuoteToken_base: (abstract new (...args: any[]) => {
|
|
|
18
18
|
/** `''`和`'''` */
|
|
19
19
|
export declare class QuoteToken extends QuoteToken_base {
|
|
20
20
|
readonly type = "quote";
|
|
21
|
+
/** 是否粗体 */
|
|
22
|
+
get bold(): boolean;
|
|
23
|
+
/** 是否斜体 */
|
|
24
|
+
get italic(): boolean;
|
|
21
25
|
/** @override */
|
|
22
26
|
lint(start?: number): LintError[];
|
|
27
|
+
/** @override */
|
|
28
|
+
json(): object;
|
|
23
29
|
}
|
|
24
30
|
export {};
|
package/dist/src/nowiki/quote.js
CHANGED
|
@@ -10,6 +10,14 @@ const base_1 = require("./base");
|
|
|
10
10
|
// @ts-expect-error not implementing all abstract methods
|
|
11
11
|
class QuoteToken extends (0, syntax_1.syntax)(base_1.NowikiBaseToken, /^(?:'{5}|'''?)$/u) {
|
|
12
12
|
type = 'quote';
|
|
13
|
+
/** 是否粗体 */
|
|
14
|
+
get bold() {
|
|
15
|
+
return this.innerText.length !== 2;
|
|
16
|
+
}
|
|
17
|
+
/** 是否斜体 */
|
|
18
|
+
get italic() {
|
|
19
|
+
return this.innerText.length !== 3;
|
|
20
|
+
}
|
|
13
21
|
/** @override */
|
|
14
22
|
lint(start = this.getAbsoluteIndex()) {
|
|
15
23
|
const { previousSibling, nextSibling } = this, message = Parser.msg('lonely "$1"', `'`), errors = [];
|
|
@@ -40,6 +48,14 @@ class QuoteToken extends (0, syntax_1.syntax)(base_1.NowikiBaseToken, /^(?:'{5}|
|
|
|
40
48
|
}
|
|
41
49
|
return errors;
|
|
42
50
|
}
|
|
51
|
+
/** @override */
|
|
52
|
+
json() {
|
|
53
|
+
return {
|
|
54
|
+
...super.json(),
|
|
55
|
+
bold: this.bold,
|
|
56
|
+
italic: this.italic,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
43
59
|
}
|
|
44
60
|
exports.QuoteToken = QuoteToken;
|
|
45
61
|
constants_1.classes['QuoteToken'] = __filename;
|
package/dist/src/transclude.js
CHANGED
|
@@ -90,9 +90,10 @@ class TranscludeToken extends index_1.Token {
|
|
|
90
90
|
}
|
|
91
91
|
if (this.type === 'template') {
|
|
92
92
|
const name = (0, string_1.removeComment)((0, string_1.decodeHtml)(title)).split('#')[0].trim();
|
|
93
|
-
if (!name ||
|
|
93
|
+
if (!name || /^:[\s_]*:|\0\d+[eh!+-]\x7F|[<>[\]{}\n]|%[\da-f]{2}/iu.test(name)) {
|
|
94
94
|
accum.pop();
|
|
95
|
-
|
|
95
|
+
Parser.debug(`非法的模板名称:${(0, string_1.noWrap)(name)}`);
|
|
96
|
+
throw new SyntaxError('非法的模板名称');
|
|
96
97
|
}
|
|
97
98
|
const token = new atom_1.AtomToken(title, 'template-name', config, accum, {
|
|
98
99
|
'Stage-2': ':', '!HeadingToken': '',
|
package/i18n/zh-hans.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
"additional \"|\" in a table cell": "表格单元格中多余的\"|\"",
|
|
5
5
|
"additional \"|\" in the link text": "链接文本中多余的\"|\"",
|
|
6
6
|
"attributes of a closing tag": "位于闭合标签的属性",
|
|
7
|
+
"bold": "粗体单引号",
|
|
7
8
|
"conflicting image $1 parameter": "冲突的图片$1参数",
|
|
8
9
|
"containing invalid attribute": "包含无效属性",
|
|
9
10
|
"content to be moved out from the table": "将被移出表格的内容",
|
|
@@ -19,6 +20,7 @@
|
|
|
19
20
|
"illegal attribute name": "非法的属性名",
|
|
20
21
|
"illegal module name": "非法的模块名称",
|
|
21
22
|
"insecure style": "不安全的样式",
|
|
23
|
+
"internal link in an external link": "外链中的内链",
|
|
22
24
|
"invalid content in <$1>": "<$1>内的无效内容",
|
|
23
25
|
"invalid conversion flag": "无效的转换标记",
|
|
24
26
|
"invalid gallery image": "无效的图库图片",
|
|
@@ -27,17 +29,20 @@
|
|
|
27
29
|
"invalid parameter of $1": "$1的无效参数",
|
|
28
30
|
"invalid self-closing tag": "无效自封闭标签",
|
|
29
31
|
"invisible content inside triple brackets": "三重括号内的不可见部分",
|
|
32
|
+
"italic": "斜体单引号",
|
|
30
33
|
"lonely \"$1\"": "孤立的\"$1\"",
|
|
31
34
|
"missing module function": "缺少模块函数",
|
|
32
35
|
"missing module name": "缺少模块名称",
|
|
33
36
|
"nonzero tabindex": "不为0的tabindex",
|
|
34
37
|
"nothing should be in <$1>": "<$1>标签内不应有任何内容",
|
|
38
|
+
"obsolete attribute": "过时的属性",
|
|
39
|
+
"obsolete HTML tag": "过时的HTML标签",
|
|
35
40
|
"quotes": "引号",
|
|
36
41
|
"section header in a HTML tag": "HTML标签属性中的段落标题",
|
|
37
42
|
"table": "表格",
|
|
38
43
|
"tag that is both closing and self-closing": "同时闭合和自封闭的标签",
|
|
39
44
|
"template in an internal link target": "内链目标包含模板",
|
|
40
|
-
"unbalanced
|
|
45
|
+
"unbalanced $1 in a section header": "段落标题中不平衡的$1",
|
|
41
46
|
"unclosed $1": "未闭合的$1",
|
|
42
47
|
"unclosed tag": "未闭合的标签",
|
|
43
48
|
"unescaped query string in an anonymous parameter": "匿名参数中未转义的查询参数",
|
package/i18n/zh-hant.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
"additional \"|\" in a table cell": "表哥單元格中多餘的\"|\"",
|
|
5
5
|
"additional \"|\" in the link text": "連結文本中多餘的\"|\"",
|
|
6
6
|
"attributes of a closing tag": "位於閉合標籤的屬性",
|
|
7
|
+
"bold apostrophes": "粗體撇號",
|
|
7
8
|
"conflicting image $1 parameter": "衝突的圖片$1參數",
|
|
8
9
|
"containing invalid attribute": "包含無效屬性",
|
|
9
10
|
"content to be moved out from the table": "將被移出表格的內容",
|
|
@@ -19,6 +20,7 @@
|
|
|
19
20
|
"illegal attribute name": "非法的屬性名",
|
|
20
21
|
"illegal module name": "非法的模組名稱",
|
|
21
22
|
"insecure style": "不安全的樣式",
|
|
23
|
+
"internal link in an external link": "外部連結中的內部連結",
|
|
22
24
|
"invalid content in <$1>": "<$1>內的無效內容",
|
|
23
25
|
"invalid conversion flag": "無效的轉換標記",
|
|
24
26
|
"invalid gallery image": "無效的圖庫圖片",
|
|
@@ -27,17 +29,20 @@
|
|
|
27
29
|
"invalid parameter of $1": "$1的無效參數",
|
|
28
30
|
"invalid self-closing tag": "無效自封閉標籤",
|
|
29
31
|
"invisible content inside triple brackets": "三重括號內的不可見部分",
|
|
32
|
+
"italic apostrophes": "斜體撇號",
|
|
30
33
|
"lonely \"$1\"": "孤立的\"$1\"",
|
|
31
34
|
"missing module function": "缺少模組函式",
|
|
32
35
|
"missing module name": "缺少模組名稱",
|
|
33
36
|
"nonzero tabindex": "不為0的tabindex",
|
|
34
37
|
"nothing should be in <$1>": "<$1>標籤內不應有任何內容",
|
|
38
|
+
"obsolete attribute": "過時的屬性",
|
|
39
|
+
"obsolete HTML tag": "過時的HTML標籤",
|
|
35
40
|
"quotes": "引號",
|
|
36
41
|
"section header in a HTML tag": "HTML標籤屬性中的段落標題",
|
|
37
42
|
"table": "表格",
|
|
38
43
|
"tag that is both closing and self-closing": "同時閉合和自封閉的標籤",
|
|
39
44
|
"template in an internal link target": "內部連結目標包含模板",
|
|
40
|
-
"unbalanced
|
|
45
|
+
"unbalanced $1 in a section header": "段落標題中不平衡的$1",
|
|
41
46
|
"unclosed $1": "未閉合的$1",
|
|
42
47
|
"unclosed tag": "未閉合的標籤",
|
|
43
48
|
"unescaped query string in an anonymous parameter": "匿名參數中未轉義的查詢參數",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wikiparser-node",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.9",
|
|
4
4
|
"description": "A Node.js parser for MediaWiki markup with AST",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mediawiki",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"lint:json": "ajv -s config/.schema.json -d 'config/*.json' --strict=true --strict-required=false",
|
|
36
36
|
"lint": "npm run lint:ts && npm run lint:json",
|
|
37
37
|
"test": "node dist/test/test.js",
|
|
38
|
+
"test:end": "pkill -x http-server",
|
|
38
39
|
"test:real": "node dist/test/real.js",
|
|
39
40
|
"test:single": "node dist/test/single.js && node --prof dist/test/single.js && node --prof-process isolate-0x*-v8.log > test/processed.txt && rm isolate-0x*-v8.log"
|
|
40
41
|
},
|