wikiparser-node 1.4.4-b → 1.4.5

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.
Files changed (164) hide show
  1. package/README.en.md +3 -3
  2. package/README.md +5 -5
  3. package/config/.schema.json +172 -0
  4. package/config/enwiki.json +814 -1
  5. package/config/llwiki.json +35 -1
  6. package/config/moegirl.json +44 -1
  7. package/config/zhwiki.json +466 -1
  8. package/dist/addon/table.d.ts +6 -0
  9. package/dist/addon/table.js +564 -0
  10. package/dist/base.d.ts +60 -0
  11. package/dist/index.d.ts +30 -0
  12. package/dist/index.js +211 -0
  13. package/dist/internal.d.ts +44 -0
  14. package/dist/lib/element.d.ts +155 -0
  15. package/dist/lib/element.js +655 -0
  16. package/dist/lib/node.d.ts +146 -0
  17. package/dist/lib/node.js +428 -0
  18. package/dist/lib/range.d.ts +104 -0
  19. package/dist/lib/range.js +385 -0
  20. package/dist/lib/ranges.d.ts +26 -0
  21. package/dist/lib/ranges.js +118 -0
  22. package/dist/lib/text.d.ts +62 -0
  23. package/dist/lib/text.js +314 -0
  24. package/dist/lib/title.d.ts +38 -0
  25. package/dist/lib/title.js +164 -0
  26. package/dist/mixin/attributesParent.d.ts +50 -0
  27. package/dist/mixin/attributesParent.js +78 -0
  28. package/dist/mixin/fixed.d.ts +6 -0
  29. package/dist/mixin/fixed.js +30 -0
  30. package/dist/mixin/flagsParent.d.ts +72 -0
  31. package/dist/mixin/flagsParent.js +59 -0
  32. package/dist/mixin/hidden.d.ts +5 -0
  33. package/dist/mixin/hidden.js +24 -0
  34. package/dist/mixin/magicLinkParent.d.ts +40 -0
  35. package/dist/mixin/magicLinkParent.js +42 -0
  36. package/dist/mixin/singleLine.d.ts +6 -0
  37. package/dist/mixin/singleLine.js +26 -0
  38. package/dist/mixin/sol.d.ts +6 -0
  39. package/dist/mixin/sol.js +43 -0
  40. package/dist/mixin/syntax.d.ts +9 -0
  41. package/dist/mixin/syntax.js +50 -0
  42. package/dist/parser/braces.js +131 -0
  43. package/dist/parser/commentAndExt.js +90 -0
  44. package/dist/parser/converter.js +41 -0
  45. package/dist/parser/externalLinks.js +32 -0
  46. package/dist/parser/hrAndDoubleUnderscore.js +41 -0
  47. package/dist/parser/html.js +39 -0
  48. package/dist/parser/links.js +95 -0
  49. package/dist/parser/list.js +68 -0
  50. package/dist/parser/magicLinks.js +43 -0
  51. package/dist/parser/quotes.js +68 -0
  52. package/dist/parser/selector.js +162 -0
  53. package/dist/parser/table.js +124 -0
  54. package/dist/src/arg.d.ts +58 -0
  55. package/dist/src/arg.js +196 -0
  56. package/dist/src/atom.d.ts +12 -0
  57. package/dist/src/atom.js +27 -0
  58. package/dist/src/attribute.d.ts +69 -0
  59. package/dist/src/attribute.js +475 -0
  60. package/dist/src/attributes.d.ts +109 -0
  61. package/dist/src/attributes.js +346 -0
  62. package/dist/src/converter.d.ts +33 -0
  63. package/dist/src/converter.js +134 -0
  64. package/dist/src/converterFlags.d.ts +87 -0
  65. package/dist/src/converterFlags.js +226 -0
  66. package/dist/src/converterRule.d.ts +77 -0
  67. package/dist/src/converterRule.js +209 -0
  68. package/dist/src/extLink.d.ts +43 -0
  69. package/dist/src/extLink.js +186 -0
  70. package/dist/src/gallery.d.ts +54 -0
  71. package/dist/src/gallery.js +127 -0
  72. package/dist/src/heading.d.ts +47 -0
  73. package/dist/src/heading.js +190 -0
  74. package/dist/src/hidden.d.ts +7 -0
  75. package/dist/src/hidden.js +23 -0
  76. package/dist/src/html.d.ts +65 -0
  77. package/dist/src/html.js +340 -0
  78. package/dist/src/imageParameter.d.ts +65 -0
  79. package/dist/src/imageParameter.js +246 -0
  80. package/dist/src/imagemap.d.ts +56 -0
  81. package/dist/src/imagemap.js +150 -0
  82. package/dist/src/imagemapLink.d.ts +31 -0
  83. package/dist/src/imagemapLink.js +93 -0
  84. package/dist/src/index.d.ts +143 -0
  85. package/dist/src/index.js +803 -0
  86. package/dist/src/link/base.d.ts +52 -0
  87. package/dist/src/link/base.js +209 -0
  88. package/dist/src/link/category.d.ts +13 -0
  89. package/dist/src/link/category.js +28 -0
  90. package/dist/src/link/file.d.ts +96 -0
  91. package/dist/src/link/file.js +265 -0
  92. package/dist/src/link/galleryImage.d.ts +32 -0
  93. package/dist/src/link/galleryImage.js +157 -0
  94. package/dist/src/link/index.d.ts +56 -0
  95. package/dist/src/link/index.js +133 -0
  96. package/dist/src/magicLink.d.ts +59 -0
  97. package/dist/src/magicLink.js +199 -0
  98. package/dist/src/nested.d.ts +43 -0
  99. package/dist/src/nested.js +92 -0
  100. package/dist/src/nowiki/base.d.ts +31 -0
  101. package/dist/src/nowiki/base.js +93 -0
  102. package/dist/src/nowiki/comment.d.ts +25 -0
  103. package/dist/src/nowiki/comment.js +70 -0
  104. package/dist/src/nowiki/dd.d.ts +8 -0
  105. package/dist/src/nowiki/dd.js +24 -0
  106. package/dist/src/nowiki/doubleUnderscore.d.ts +18 -0
  107. package/dist/src/nowiki/doubleUnderscore.js +101 -0
  108. package/dist/src/nowiki/hr.d.ts +5 -0
  109. package/dist/src/nowiki/hr.js +63 -0
  110. package/dist/src/nowiki/index.d.ts +16 -0
  111. package/dist/src/nowiki/index.js +21 -0
  112. package/dist/src/nowiki/list.d.ts +16 -0
  113. package/dist/src/nowiki/list.js +97 -0
  114. package/dist/src/nowiki/listBase.d.ts +5 -0
  115. package/dist/src/nowiki/listBase.js +61 -0
  116. package/dist/src/nowiki/noinclude.d.ts +10 -0
  117. package/dist/src/nowiki/noinclude.js +23 -0
  118. package/dist/src/nowiki/quote.d.ts +14 -0
  119. package/dist/src/nowiki/quote.js +117 -0
  120. package/dist/src/onlyinclude.d.ts +16 -0
  121. package/dist/src/onlyinclude.js +57 -0
  122. package/dist/src/paramTag/index.d.ts +37 -0
  123. package/dist/src/paramTag/index.js +69 -0
  124. package/dist/src/paramTag/inputbox.d.ts +8 -0
  125. package/dist/src/paramTag/inputbox.js +22 -0
  126. package/dist/src/parameter.d.ts +70 -0
  127. package/dist/src/parameter.js +262 -0
  128. package/dist/src/pre.d.ts +28 -0
  129. package/dist/src/pre.js +55 -0
  130. package/dist/src/syntax.d.ts +20 -0
  131. package/dist/src/syntax.js +86 -0
  132. package/dist/src/table/base.d.ts +30 -0
  133. package/dist/src/table/base.js +132 -0
  134. package/dist/src/table/index.d.ts +233 -0
  135. package/dist/src/table/index.js +396 -0
  136. package/dist/src/table/td.d.ts +92 -0
  137. package/dist/src/table/td.js +337 -0
  138. package/dist/src/table/tr.d.ts +32 -0
  139. package/dist/src/table/tr.js +58 -0
  140. package/dist/src/table/trBase.d.ts +53 -0
  141. package/dist/src/table/trBase.js +154 -0
  142. package/dist/src/tagPair/ext.d.ts +32 -0
  143. package/dist/src/tagPair/ext.js +203 -0
  144. package/dist/src/tagPair/include.d.ts +35 -0
  145. package/dist/src/tagPair/include.js +65 -0
  146. package/dist/src/tagPair/index.d.ts +27 -0
  147. package/dist/src/tagPair/index.js +128 -0
  148. package/dist/src/transclude.d.ts +167 -0
  149. package/dist/src/transclude.js +710 -0
  150. package/dist/util/constants.js +113 -0
  151. package/dist/util/debug.js +88 -0
  152. package/dist/util/diff.js +82 -0
  153. package/dist/util/lint.js +31 -0
  154. package/dist/util/string.js +53 -0
  155. package/errors/README +1 -0
  156. package/package.json +14 -27
  157. package/printed/README +1 -0
  158. package/bundle/bundle.min.js +0 -36
  159. package/extensions/dist/base.js +0 -64
  160. package/extensions/dist/editor.js +0 -159
  161. package/extensions/dist/highlight.js +0 -59
  162. package/extensions/dist/lint.js +0 -48
  163. package/extensions/editor.css +0 -63
  164. package/extensions/ui.css +0 -141
package/README.en.md CHANGED
@@ -8,11 +8,11 @@
8
8
 
9
9
  # Introduction
10
10
 
11
- wikiparser-node is an offline [Wikitext](https://www.mediawiki.org/wiki/Wikitext) parser developed by Bhsd for the [Node.js](https://nodejs.org/) environment. It can parse almost all wiki syntax and generate an [Abstract Syntax Tree (AST)](https://en.wikipedia.org/wiki/Abstract_syntax_tree) ([Try it online](https://bhsd-harry.github.io/wikiparser-node/#editor)). It also allows for easy querying and modification of the AST, and returns the modified wikitext.
11
+ WikiParser-Node is an offline [Wikitext](https://www.mediawiki.org/wiki/Wikitext) parser developed by Bhsd for the [Node.js](https://nodejs.org/) environment. It can parse almost all wiki syntax and generate an [Abstract Syntax Tree (AST)](https://en.wikipedia.org/wiki/Abstract_syntax_tree) ([Try it online](https://bhsd-harry.github.io/wikiparser-node/#editor)). It also allows for easy querying and modification of the AST, and returns the modified wikitext.
12
12
 
13
13
  # Other Versions
14
14
 
15
- ## Mini (also known as [wikilint](https://www.npmjs.com/package/wikilint))
15
+ ## Mini (also known as [WikiLint](https://www.npmjs.com/package/wikilint))
16
16
 
17
17
  This version provides a [CLI](https://en.wikipedia.org/wiki/Command-line_interface), but only retains the parsing functionality and linting functionality. The parsed AST cannot be modified. It is used in the [eslint-plugin-wikitext](https://www.npmjs.com/package/eslint-plugin-wikitext) plugin.
18
18
 
@@ -24,7 +24,7 @@ A browser-compatible version, which can be used for code highlighting or as a li
24
24
 
25
25
  ## Node.js
26
26
 
27
- Please install the corresponding version as needed (`wikiparser-node` or `wikilint`), for example:
27
+ Please install the corresponding version as needed (`WikiParser-Node` or `WikiLint`), for example:
28
28
 
29
29
  ```sh
30
30
  npm i wikiparser-node
package/README.md CHANGED
@@ -8,11 +8,11 @@
8
8
 
9
9
  # 简介
10
10
 
11
- wikiparser-node 是一款由 Bhsd 开发的基于 [Node.js](https://nodejs.org/) 环境的离线[维基文本](https://www.mediawiki.org/wiki/Wikitext)语法解析器,可以解析几乎全部的维基语法并生成[语法树](https://en.wikipedia.org/wiki/Abstract_syntax_tree)([在线解析](https://bhsd-harry.github.io/wikiparser-node/#editor)),还可以很方便地对语法树进行查询和修改,最后返回修改后的维基文本。
11
+ WikiParser-Node 是一款由 Bhsd 开发的基于 [Node.js](https://nodejs.org/) 环境的离线[维基文本](https://www.mediawiki.org/wiki/Wikitext)语法解析器,可以解析几乎全部的维基语法并生成[语法树](https://en.wikipedia.org/wiki/Abstract_syntax_tree)([在线解析](https://bhsd-harry.github.io/wikiparser-node/#editor)),还可以很方便地对语法树进行查询和修改,最后返回修改后的维基文本。
12
12
 
13
13
  # 其他版本
14
14
 
15
- ## Mini (又名 [wikilint](https://www.npmjs.com/package/wikilint))
15
+ ## Mini (又名 [WikiLint](https://www.npmjs.com/package/wikilint))
16
16
 
17
17
  提供了 [CLI](https://en.wikipedia.org/wiki/Command-line_interface),但仅保留了解析功能和语法错误分析功能,解析生成的语法树不能修改。这个版本被应用于 [eslint-plugin-wikitext](https://www.npmjs.com/package/eslint-plugin-wikitext) 插件。
18
18
 
@@ -24,7 +24,7 @@ wikiparser-node 是一款由 Bhsd 开发的基于 [Node.js](https://nodejs.org/)
24
24
 
25
25
  ## Node.js
26
26
 
27
- 请根据需要需要安装对应的版本(`wikiparser-node` 或 `wikilint`),如:
27
+ 请根据需要需要安装对应的版本(`WikiParser-Node` 或 `WikiLint`),如:
28
28
 
29
29
  ```sh
30
30
  npm i wikiparser-node
@@ -41,13 +41,13 @@ npm i wikilint
41
41
  可以通过 CDN 下载代码,如:
42
42
 
43
43
  ```html
44
- <script src="//cdn.jsdelivr.net/npm/wikiparser-node@browser/bundle/bundle.min.js"></script>
44
+ <script src="//cdn.jsdelivr.net/npm/wikiparser-node@browser"></script>
45
45
  ```
46
46
 
47
47
 
48
48
 
49
49
  ```html
50
- <script src="//unpkg.com/wikiparser-node@browser/bundle/bundle.min.js"></script>
50
+ <script src="//unpkg.com/wikiparser-node@browser"></script>
51
51
  ```
52
52
 
53
53
  更多浏览器端可用的插件请查阅对应[文档](https://github.com/bhsd-harry/wikiparser-node/wiki/Browser)。
@@ -0,0 +1,172 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "ext": {
5
+ "description": "extension tags",
6
+ "type": "array",
7
+ "items": {
8
+ "type": "string",
9
+ "pattern": "^[a-z\\d_]+$"
10
+ }
11
+ },
12
+ "html": {
13
+ "description": "valid HTML tags",
14
+ "type": "array",
15
+ "items": {
16
+ "type": "array",
17
+ "items": {
18
+ "type": "string",
19
+ "pattern": "^[a-z\\d]+$"
20
+ }
21
+ },
22
+ "minItems": 3,
23
+ "maxItems": 3
24
+ },
25
+ "namespaces": {
26
+ "description": "formatted namespaces",
27
+ "type": "object",
28
+ "patternProperties": {
29
+ "^-?\\d+$": {
30
+ "type": "string"
31
+ }
32
+ },
33
+ "additionalProperties": false
34
+ },
35
+ "nsid": {
36
+ "description": "namespace IDs",
37
+ "type": "object",
38
+ "required": [
39
+ "file",
40
+ "category"
41
+ ],
42
+ "additionalProperties": {
43
+ "type": "integer"
44
+ }
45
+ },
46
+ "parserFunction": {
47
+ "type": "array",
48
+ "items": [
49
+ {
50
+ "description": "case-insensitive parser functions",
51
+ "type": "object",
52
+ "additionalProperties": {
53
+ "type": "string"
54
+ }
55
+ },
56
+ {
57
+ "description": "case-sensitive parser functions",
58
+ "type": "array",
59
+ "allOf": [
60
+ {
61
+ "contains": {
62
+ "const": "!"
63
+ }
64
+ },
65
+ {
66
+ "contains": {
67
+ "const": "="
68
+ }
69
+ }
70
+ ],
71
+ "items": {
72
+ "type": "string"
73
+ }
74
+ },
75
+ {
76
+ "description": "msg and raw",
77
+ "type": "array",
78
+ "items": {
79
+ "type": "string"
80
+ }
81
+ },
82
+ {
83
+ "description": "subst and safesubst",
84
+ "type": "array",
85
+ "items": {
86
+ "type": "string"
87
+ }
88
+ }
89
+ ],
90
+ "minItems": 4,
91
+ "maxItems": 4
92
+ },
93
+ "doubleUnderscore": {
94
+ "description": "behavior switches",
95
+ "type": "array",
96
+ "items": {
97
+ "type": "array",
98
+ "items": {
99
+ "type": "string"
100
+ }
101
+ },
102
+ "minItems": 2,
103
+ "maxItems": 2
104
+ },
105
+ "protocol": {
106
+ "description": "external link protocols",
107
+ "type": "string",
108
+ "pattern": "^[a-z:/]+(?:\\|[a-z:/]+)*$"
109
+ },
110
+ "interwiki": {
111
+ "type": "array",
112
+ "items": {
113
+ "type": "string"
114
+ }
115
+ },
116
+ "img": {
117
+ "description": "image-related magic words",
118
+ "type": "object",
119
+ "additionalProperties": {
120
+ "type": "string",
121
+ "pattern": "^[-a-z]+$"
122
+ }
123
+ },
124
+ "variants": {
125
+ "description": "variants for language conversion",
126
+ "type": "array",
127
+ "items": {
128
+ "type": "string",
129
+ "pattern": "^[-a-z]+$"
130
+ }
131
+ },
132
+ "conversionTable": {
133
+ "description": "table of unidirectional conversions",
134
+ "type": "array",
135
+ "items": {
136
+ "type": "array",
137
+ "items": {
138
+ "type": "string",
139
+ "pattern": "^[^ <>[\\]{}|]+$"
140
+ },
141
+ "minItems": 2,
142
+ "maxItems": 2
143
+ }
144
+ },
145
+ "redirects": {
146
+ "description": "table of redirects",
147
+ "type": "array",
148
+ "items": {
149
+ "type": "array",
150
+ "items": {
151
+ "type": "string",
152
+ "pattern": "^[^ <>[\\]{}|]+$"
153
+ },
154
+ "minItems": 2,
155
+ "maxItems": 2
156
+ }
157
+ }
158
+ },
159
+ "required": [
160
+ "ext",
161
+ "html",
162
+ "namespaces",
163
+ "nsid",
164
+ "parserFunction",
165
+ "doubleUnderscore",
166
+ "protocol",
167
+ "interwiki",
168
+ "img",
169
+ "variants"
170
+ ],
171
+ "additionalProperties": false
172
+ }