wikiparser-node 1.5.0 → 1.5.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.
@@ -767,7 +767,7 @@
767
767
  "EXPECTED_UNCONNECTED_PAGE"
768
768
  ]
769
769
  ],
770
- "protocol": "bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",
770
+ "protocol": "bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",
771
771
  "interwiki": [],
772
772
  "img": {
773
773
  "thumbnail": "thumbnail",
@@ -369,7 +369,7 @@
369
369
  "EXPECTED_UNCONNECTED_PAGE"
370
370
  ]
371
371
  ],
372
- "protocol": "bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",
372
+ "protocol": "bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",
373
373
  "interwiki": [
374
374
  "acronym",
375
375
  "advisory",
@@ -518,7 +518,7 @@
518
518
  "静态重定向"
519
519
  ]
520
520
  ],
521
- "protocol": "bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",
521
+ "protocol": "bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",
522
522
  "interwiki": [
523
523
  "arxiv",
524
524
  "aswiki",
@@ -66,8 +66,7 @@
66
66
  "wbr",
67
67
  "hr",
68
68
  "meta",
69
- "link",
70
- "img"
69
+ "link"
71
70
  ]
72
71
  ],
73
72
  "namespaces": {},
@@ -82,6 +81,7 @@
82
81
  "#speciale": "speciale",
83
82
  "#tag": "tag",
84
83
  "#formatdate": "formatdate",
84
+ "#dateformat": "formatdate",
85
85
  "#invoke": "invoke",
86
86
  "#while": "while",
87
87
  "#dowhile": "dowhile",
@@ -118,13 +118,10 @@
118
118
  ],
119
119
  [
120
120
  "msg",
121
- "原始",
122
121
  "raw"
123
122
  ],
124
123
  [
125
- "替代",
126
124
  "subst",
127
- "安全替代",
128
125
  "safesubst"
129
126
  ]
130
127
  ],
@@ -132,7 +129,7 @@
132
129
  [],
133
130
  []
134
131
  ],
135
- "protocol": "bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",
132
+ "protocol": "bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",
136
133
  "interwiki": [],
137
134
  "img": {},
138
135
  "variants": []
@@ -707,7 +707,7 @@
707
707
  "EXPECTED_UNCONNECTED_PAGE"
708
708
  ]
709
709
  ],
710
- "protocol": "bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",
710
+ "protocol": "bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",
711
711
  "interwiki": [
712
712
  "acronym",
713
713
  "advisory",
package/dist/base.d.ts CHANGED
@@ -13,9 +13,10 @@ export interface Config {
13
13
  readonly conversionTable?: [string, string][];
14
14
  readonly redirects?: [string, string][];
15
15
  }
16
+ export declare const rules: readonly ["bold-header", "format-leakage", "fostered-content", "h1", "illegal-attr", "insecure-style", "invalid-gallery", "invalid-imagemap", "invalid-invoke", "lonely-apos", "lonely-bracket", "lonely-http", "nested-link", "no-arg", "no-duplicate", "no-ignored", "obsolete-attr", "obsolete-tag", "parsing-order", "pipe-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"];
16
17
  export declare namespace LintError {
17
18
  type Severity = 'error' | 'warning';
18
- type Rule = 'bold-header' | 'format-leakage' | 'fostered-content' | 'h1' | 'illegal-attr' | 'insecure-style' | 'invalid-gallery' | 'invalid-imagemap' | 'invalid-invoke' | 'lonely-apos' | 'lonely-bracket' | 'lonely-http' | 'nested-link' | 'no-arg' | 'no-duplicate' | 'no-ignored' | 'obsolete-attr' | 'obsolete-tag' | 'parsing-order' | 'pipe-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';
19
+ type Rule = typeof rules[number];
19
20
  interface Fix {
20
21
  readonly range: [number, number];
21
22
  text: string;
@@ -58,6 +59,7 @@ interface AstElement extends AstNode {
58
59
  export interface Parser {
59
60
  config: string | Config;
60
61
  i18n: string | Record<string, string> | undefined;
62
+ rules: readonly LintError.Rule[];
61
63
  /** 获取解析设置 */
62
64
  getConfig(): Config;
63
65
  /**
package/dist/base.js ADDED
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rules = void 0;
4
+ exports.rules = [
5
+ 'bold-header',
6
+ 'format-leakage',
7
+ 'fostered-content',
8
+ 'h1',
9
+ 'illegal-attr',
10
+ 'insecure-style',
11
+ 'invalid-gallery',
12
+ 'invalid-imagemap',
13
+ 'invalid-invoke',
14
+ 'lonely-apos',
15
+ 'lonely-bracket',
16
+ 'lonely-http',
17
+ 'nested-link',
18
+ 'no-arg',
19
+ 'no-duplicate',
20
+ 'no-ignored',
21
+ 'obsolete-attr',
22
+ 'obsolete-tag',
23
+ 'parsing-order',
24
+ 'pipe-like',
25
+ 'table-layout',
26
+ 'tag-like',
27
+ 'unbalanced-header',
28
+ 'unclosed-comment',
29
+ 'unclosed-quote',
30
+ 'unclosed-table',
31
+ 'unescaped',
32
+ 'unknown-page',
33
+ 'unmatched-tag',
34
+ 'unterminated-url',
35
+ 'url-encoding',
36
+ 'var-anchor',
37
+ 'void-ext',
38
+ ];
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@
3
3
  const fs = require("fs");
4
4
  const path = require("path");
5
5
  const chalk = require("chalk");
6
+ const base_1 = require("./base");
6
7
  const debug_1 = require("./util/debug");
7
8
  const constants_1 = require("./util/constants");
8
9
  const string_1 = require("./util/string");
@@ -17,6 +18,7 @@ const rootRequire = (file, dir) => require(file.startsWith('/') ? file : `../${f
17
18
  const Parser = {
18
19
  config: 'default',
19
20
  i18n: undefined,
21
+ rules: base_1.rules,
20
22
  /* NOT FOR BROWSER */
21
23
  conversionTable: new Map(),
22
24
  redirects: new Map(),
@@ -413,7 +413,7 @@ class AstElement extends node_1.AstNode {
413
413
  return this.#isProtected() === false;
414
414
  default: {
415
415
  const [t, n] = selector.split('#');
416
- return (!t || t === type || Boolean(constants_1.typeAliases[type]?.includes(t))) && (!n || n === name);
416
+ return (!t || t === type) && (!n || n === name);
417
417
  }
418
418
  }
419
419
  }
@@ -23,7 +23,8 @@ const parseList = (wikitext, config = index_1.default.getConfig(), accum = []) =
23
23
  if (!dt) {
24
24
  return text;
25
25
  }
26
- let regex = /:+|-\{/gu, ex = regex.exec(text), lc = 0;
26
+ const { html: [normalTags] } = config, fullRegex = /:+|-\{|\0\d+x\x7F/gu;
27
+ let regex = fullRegex, ex = regex.exec(text), lt = 0, lc = 0;
27
28
  /**
28
29
  * 创建`DdToken`
29
30
  * @param syntax `:`
@@ -36,15 +37,7 @@ const parseList = (wikitext, config = index_1.default.getConfig(), accum = []) =
36
37
  };
37
38
  while (ex && dt) {
38
39
  const { 0: syntax, index } = ex;
39
- if (syntax.startsWith(':')) {
40
- if (syntax.length >= dt) {
41
- return dd(syntax.slice(0, dt), index);
42
- }
43
- dt -= syntax.length;
44
- regex.lastIndex = index + 4 + String(accum.length).length;
45
- text = dd(syntax, index);
46
- }
47
- else if (syntax === '-{') {
40
+ if (syntax === '-{') {
48
41
  if (!lc) {
49
42
  const { lastIndex } = regex;
50
43
  regex = /-\{|\}-/gu;
@@ -52,14 +45,33 @@ const parseList = (wikitext, config = index_1.default.getConfig(), accum = []) =
52
45
  }
53
46
  lc++;
54
47
  }
55
- else {
48
+ else if (syntax === '}-') {
56
49
  lc--;
57
50
  if (!lc) {
58
51
  const { lastIndex } = regex;
59
- regex = /:+|-\{/gu;
52
+ regex = fullRegex;
60
53
  regex.lastIndex = lastIndex;
61
54
  }
62
55
  }
56
+ else if (syntax.startsWith('\0')) {
57
+ const { name, closing, selfClosing } = accum[Number(syntax.slice(1, -2))];
58
+ if (!selfClosing || normalTags.includes(name)) {
59
+ if (!closing) {
60
+ lt++;
61
+ }
62
+ else if (lt) {
63
+ lt--;
64
+ }
65
+ }
66
+ }
67
+ else if (lt === 0) { // syntax === ':'
68
+ if (syntax.length >= dt) {
69
+ return dd(syntax.slice(0, dt), index);
70
+ }
71
+ dt -= syntax.length;
72
+ regex.lastIndex = index + 4 + String(accum.length).length;
73
+ text = dd(syntax, index);
74
+ }
63
75
  ex = regex.exec(text);
64
76
  }
65
77
  return text;
@@ -59,6 +59,7 @@ const commonHtmlAttrs = new Set([
59
59
  'aria-hidden',
60
60
  'aria-label',
61
61
  'aria-labelledby',
62
+ 'aria-level',
62
63
  'aria-owns',
63
64
  'role',
64
65
  'about',
@@ -184,7 +185,7 @@ const commonHtmlAttrs = new Set([
184
185
  combobox: new Set(['placeholder', 'value', 'id', 'class', 'text', 'dropdown', 'style']),
185
186
  }, insecureStyle = new RegExp('expression'
186
187
  + '|'
187
- + '(?:filter|accelerator|-o-link(?:-source)?|-o-replace)\\s*:'
188
+ + '(?:accelerator|-o-link(?:-source)?|-o-replace)\\s*:'
188
189
  + '|'
189
190
  + '(?:url|image(?:-set)?)\\s*\\('
190
191
  + '|'
@@ -356,7 +357,7 @@ let AttributeToken = (() => {
356
357
  if (lastChild.childNodes.some(child => child.type === 'text' && /\s/u.test(child.text()))) {
357
358
  e.suggestions = [
358
359
  {
359
- desc: 'quote',
360
+ desc: 'close',
360
361
  ...fix,
361
362
  },
362
363
  ];
@@ -19,12 +19,12 @@ export declare abstract class HtmlToken extends Token {
19
19
  abstract get children(): [AttributesToken];
20
20
  abstract get firstElementChild(): AttributesToken;
21
21
  abstract get lastElementChild(): AttributesToken;
22
+ /** 是否自封闭 */
23
+ get selfClosing(): boolean;
22
24
  /** 是否是闭合标签 */
23
25
  get closing(): boolean;
24
26
  /** @throws `Error` 自封闭标签或空标签 */
25
27
  set closing(value: boolean);
26
- /** 是否自封闭 */
27
- get selfClosing(): boolean;
28
28
  /** @throws `Error` 闭合标签或无效自封闭标签 */
29
29
  set selfClosing(value: boolean);
30
30
  /**
package/dist/src/html.js CHANGED
@@ -95,6 +95,10 @@ let HtmlToken = (() => {
95
95
  #selfClosing;
96
96
  #tag;
97
97
  /* NOT FOR BROWSER END */
98
+ /** 是否自封闭 */
99
+ get selfClosing() {
100
+ return this.#selfClosing;
101
+ }
98
102
  /** 是否是闭合标签 */
99
103
  get closing() {
100
104
  return this.#closing;
@@ -115,10 +119,6 @@ let HtmlToken = (() => {
115
119
  }
116
120
  this.#closing = true;
117
121
  }
118
- /** 是否自封闭 */
119
- get selfClosing() {
120
- return this.#selfClosing;
121
- }
122
122
  /** @throws `Error` 闭合标签或无效自封闭标签 */
123
123
  set selfClosing(value) {
124
124
  if (!value) {
@@ -265,14 +265,14 @@ let HtmlToken = (() => {
265
265
  * @throws `SyntaxError` 未匹配的标签
266
266
  */
267
267
  findMatchingTag() {
268
- const { html } = this.getAttribute('config'), { name: tagName, parentNode, closing } = this, string = (0, string_1.noWrap)(String(this));
269
- if (closing && (this.#selfClosing || html[2].includes(tagName))) {
268
+ const { html: [normalTags, flexibleTags, voidTags] } = this.getAttribute('config'), { name: tagName, parentNode, closing } = this, string = (0, string_1.noWrap)(String(this));
269
+ if (closing && (this.#selfClosing || voidTags.includes(tagName))) {
270
270
  throw new SyntaxError(`tag that is both closing and self-closing: ${string}`);
271
271
  }
272
- else if (html[2].includes(tagName) || this.#selfClosing && html[1].includes(tagName)) { // 自封闭标签
272
+ else if (voidTags.includes(tagName) || this.#selfClosing && flexibleTags.includes(tagName)) { // 自封闭标签
273
273
  return this;
274
274
  }
275
- else if (this.#selfClosing && html[0].includes(tagName)) {
275
+ else if (this.#selfClosing && normalTags.includes(tagName)) {
276
276
  throw new SyntaxError(`invalid self-closing tag: ${string}`);
277
277
  }
278
278
  else if (!parentNode) {
@@ -332,8 +332,8 @@ let HtmlToken = (() => {
332
332
  * @throws `Error` 无法修复无效自封闭标签
333
333
  */
334
334
  fix() {
335
- const config = this.getAttribute('config'), { parentNode, name: tagName, firstChild, selfClosing } = this;
336
- if (!parentNode || !selfClosing || !config.html[0].includes(tagName)) {
335
+ const { html: [normalTags] } = this.getAttribute('config'), { parentNode, name: tagName, firstChild, selfClosing } = this;
336
+ if (!parentNode || !selfClosing || !normalTags.includes(tagName)) {
337
337
  return;
338
338
  }
339
339
  else if (firstChild.text().trim()) {
@@ -42,10 +42,13 @@ class IncludeToken extends (0, hidden_1.hiddenToken)(index_2.TagPairToken) {
42
42
  return [];
43
43
  }
44
44
  const e = (0, lint_1.generateForSelf)(this, { start }, 'unclosed-comment', index_1.default.msg('unclosed $1', `<${this.name}>`));
45
- e.fix = {
46
- range: [e.endIndex, e.endIndex],
47
- text: `</${this.name}>`,
48
- };
45
+ e.suggestions = [
46
+ {
47
+ desc: 'close',
48
+ range: [e.endIndex, e.endIndex],
49
+ text: `</${this.name}>`,
50
+ },
51
+ ];
49
52
  return [e];
50
53
  }
51
54
  /* NOT FOR BROWSER */
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.promises = exports.typeAliases = exports.aliases = exports.parsers = exports.mixins = exports.classes = exports.BuildMethod = exports.MAX_STAGE = void 0;
3
+ exports.promises = exports.aliases = exports.parsers = exports.mixins = exports.classes = exports.BuildMethod = exports.MAX_STAGE = void 0;
4
4
  exports.MAX_STAGE = 11;
5
5
  var BuildMethod;
6
6
  (function (BuildMethod) {
@@ -25,89 +25,4 @@ exports.aliases = [
25
25
  ['ListToken', 'DdToken'],
26
26
  ['ConverterToken'],
27
27
  ];
28
- exports.typeAliases = {
29
- text: ['string', 'str'],
30
- plain: ['regular', 'normal'],
31
- root: undefined,
32
- // comment and extension
33
- onlyinclude: ['only-include'],
34
- noinclude: ['no-include'],
35
- include: ['includeonly', 'include-only'],
36
- comment: undefined,
37
- ext: ['extension'],
38
- 'ext-attrs': ['extension-attrs', 'ext-attributes', 'extension-attributes'],
39
- 'ext-attr-dirty': ['extension-attr-dirty', 'ext-attribute-dirty', 'extension-attribute-dirty'],
40
- 'ext-attr': ['extension-attr', 'ext-attribute', 'extension-attribute'],
41
- 'attr-key': ['attribute-key'],
42
- 'attr-value': ['attribute-value', 'attr-val', 'attribute-val'],
43
- 'ext-inner': ['extension-inner'],
44
- // triple braces
45
- arg: ['argument'],
46
- 'arg-name': ['argument-name'],
47
- 'arg-default': ['argument-default'],
48
- hidden: ['arg-redundant'],
49
- // double braces
50
- 'magic-word': ['parser-function', 'parser-func'],
51
- 'magic-word-name': ['parser-function-name', 'parser-func-name'],
52
- 'invoke-function': ['invoke-func', 'lua-function', 'lua-func', 'module-function', 'module-func'],
53
- 'invoke-module': ['lua-module'],
54
- template: undefined,
55
- 'template-name': undefined,
56
- parameter: ['param'],
57
- 'parameter-key': ['param-key'],
58
- 'parameter-value': ['parameter-val', 'param-value', 'param-val'],
59
- // heading
60
- heading: ['header'],
61
- 'heading-title': ['header-title'],
62
- 'heading-trail': ['header-trail'],
63
- // html
64
- html: undefined,
65
- 'html-attrs': ['html-attributes'],
66
- 'html-attr-dirty': ['html-attribute-dirty'],
67
- 'html-attr': ['html-attribute'],
68
- // table
69
- table: undefined,
70
- tr: ['table-row'],
71
- td: ['table-cell', 'table-data'],
72
- 'table-syntax': undefined,
73
- 'table-attrs': ['tr-attrs', 'td-attrs', 'table-attributes', 'tr-attributes', 'td-attributes'],
74
- 'table-attr-dirty': ['tr-attr-dirty', 'td-attr-dirty', 'table-attribute-dirty', 'tr-attribute-dirty', 'td-attribute-dirty'],
75
- 'table-attr': ['tr-attr', 'td-attr', 'table-attribute', 'tr-attribute', 'td-attribute'],
76
- 'table-inter': undefined,
77
- 'td-inner': ['table-cell-inner', 'table-data-inner'],
78
- // hr and double-underscore
79
- hr: ['horizontal'],
80
- 'double-underscore': ['underscore', 'behavior-switch', 'behaviour-switch'],
81
- // link
82
- link: ['wikilink'],
83
- 'link-target': ['wikilink-target'],
84
- 'link-text': ['wikilink-text'],
85
- category: ['category-link', 'cat', 'cat-link'],
86
- file: ['file-link', 'image', 'image-link', 'img', 'img-link'],
87
- 'gallery-image': ['gallery-file', 'gallery-img'],
88
- 'imagemap-image': ['imagemap-file', 'imagemap-img', 'image-map-image', 'image-map-file', 'image-map-img'],
89
- 'image-parameter': ['img-parameter', 'image-param', 'img-param'],
90
- // quotes
91
- quote: ['quotes', 'quot', 'apostrophe', 'apostrophes', 'apos'],
92
- // external link
93
- 'ext-link': ['external-link'],
94
- 'ext-link-text': ['external-link-text'],
95
- 'ext-link-url': ['external-link-url'],
96
- // magic link
97
- 'free-ext-link': ['free-external-link', 'magic-link'],
98
- // list
99
- list: ['ol', 'ordered-list', 'ul', 'unordered-list', 'dl', 'description-list'],
100
- dd: ['indent', 'indentation'],
101
- // converter
102
- converter: ['convert', 'conversion'],
103
- 'converter-flags': ['convert-flags', 'conversion-flags'],
104
- 'converter-flag': ['convert-flag', 'conversion-flag'],
105
- 'converter-rule': ['convert-rule', 'conversion-rule'],
106
- 'converter-rule-variant': ['convert-rule-variant', 'conversion-rule-variant'],
107
- 'converter-rule-to': ['convert-rule-to', 'conversion-rule-to', 'converter-rule-noconvert'],
108
- 'converter-rule-from': ['convert-rule-from', 'conversion-rule-from'],
109
- // specific extensions
110
- 'param-line': ['parameter-line'],
111
- 'imagemap-link': ['image-map-link'],
112
- };
113
28
  exports.promises = [Promise.resolve()];
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.normalizeSpace = exports.print = exports.noWrap = exports.decodeHtml = exports.text = exports.escapeRegExp = exports.removeComment = exports.tidy = exports.extUrlChar = exports.extUrlCharFirst = void 0;
4
- exports.extUrlCharFirst = '(?:\\[[\\da-f:.]+\\]|[^[\\]<>"\0-\x1F\x7F\\p{Zs}\uFFFD])';
5
- exports.extUrlChar = '(?:[^[\\]<>"\0-\x1F\x7F\\p{Zs}\uFFFD]|\0\\d+[c!~]\x7F)*';
4
+ const commonExtUrlChar = '[^[\\]<>"\0-\x1F\x7F\\p{Zs}\uFFFD]';
5
+ exports.extUrlCharFirst = `(?:\\[[\\da-f:.]+\\]|${commonExtUrlChar})`;
6
+ exports.extUrlChar = `(?:${commonExtUrlChar}|\0\\d+[c!~]\x7F)*`;
6
7
  /**
7
8
  * 生成正则替换函数
8
9
  * @param regex 正则表达式
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wikiparser-node",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "A Node.js parser for MediaWiki markup with AST",
5
5
  "keywords": [
6
6
  "mediawiki",
@@ -29,7 +29,7 @@
29
29
  "scripts": {
30
30
  "toc": "node ./dist/bin/toc.js",
31
31
  "declaration": "grep -rl --include='*.d.ts' '@private' dist/ | xargs bash sed.sh -i -E '/^\\s+\\/\\*\\* @private/,+1d'; node ./dist/bin/declaration.js",
32
- "prepublishOnly": "npm run build && rm dist/internal.js dist/base.js dist/[pu]*/*.d.ts",
32
+ "prepublishOnly": "npm run build && rm dist/internal.js dist/[pu]*/*.d.ts",
33
33
  "build": "bash build.sh",
34
34
  "diff": "bash diff.sh",
35
35
  "diff:stat": "f() { git diff --stat --ignore-all-space --color=always $1 $2 -- . ':!extensions/' ':!bin/' | grep '\\.ts'; }; f",