wikiparser-node 1.1.1-b → 1.1.2

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 (156) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +1 -1
  3. package/config/.schema.json +160 -0
  4. package/config/llwiki.json +35 -1
  5. package/config/moegirl.json +44 -1
  6. package/config/zhwiki.json +466 -1
  7. package/dist/addon/table.d.ts +6 -0
  8. package/dist/addon/table.js +559 -0
  9. package/dist/base.d.ts +45 -0
  10. package/dist/bin/toc.js +18 -0
  11. package/dist/index.d.ts +36 -0
  12. package/dist/index.js +210 -0
  13. package/dist/internal.d.ts +44 -0
  14. package/dist/lib/element.d.ts +155 -0
  15. package/dist/lib/element.js +664 -0
  16. package/dist/lib/node.d.ts +146 -0
  17. package/dist/lib/node.js +419 -0
  18. package/dist/lib/range.d.ts +104 -0
  19. package/dist/lib/range.js +386 -0
  20. package/dist/lib/ranges.d.ts +26 -0
  21. package/dist/lib/ranges.js +117 -0
  22. package/dist/lib/text.d.ts +65 -0
  23. package/dist/lib/text.js +223 -0
  24. package/dist/lib/title.d.ts +38 -0
  25. package/dist/lib/title.js +162 -0
  26. package/dist/mixin/attributesParent.js +94 -0
  27. package/dist/mixin/fixed.js +32 -0
  28. package/dist/mixin/flagsParent.js +70 -0
  29. package/dist/mixin/hidden.js +22 -0
  30. package/dist/mixin/magicLinkParent.js +41 -0
  31. package/dist/mixin/singleLine.js +25 -0
  32. package/dist/mixin/sol.js +43 -0
  33. package/dist/mixin/syntax.js +56 -0
  34. package/dist/parser/braces.js +123 -0
  35. package/dist/parser/commentAndExt.js +69 -0
  36. package/dist/parser/converter.js +40 -0
  37. package/dist/parser/externalLinks.js +28 -0
  38. package/dist/parser/hrAndDoubleUnderscore.js +38 -0
  39. package/dist/parser/html.js +36 -0
  40. package/dist/parser/links.js +94 -0
  41. package/dist/parser/list.js +59 -0
  42. package/dist/parser/magicLinks.js +40 -0
  43. package/dist/parser/quotes.js +67 -0
  44. package/dist/parser/selector.js +163 -0
  45. package/dist/parser/table.js +110 -0
  46. package/dist/src/arg.d.ts +58 -0
  47. package/dist/src/arg.js +190 -0
  48. package/dist/src/atom.d.ts +12 -0
  49. package/dist/src/atom.js +27 -0
  50. package/dist/src/attribute.d.ts +86 -0
  51. package/dist/src/attribute.js +392 -0
  52. package/dist/src/attributes.d.ts +106 -0
  53. package/dist/src/attributes.js +338 -0
  54. package/dist/src/converter.d.ts +51 -0
  55. package/dist/src/converter.js +79 -0
  56. package/dist/src/converterFlags.d.ts +87 -0
  57. package/dist/src/converterFlags.js +223 -0
  58. package/dist/src/converterRule.d.ts +81 -0
  59. package/dist/src/converterRule.js +212 -0
  60. package/dist/src/extLink.d.ts +53 -0
  61. package/dist/src/extLink.js +121 -0
  62. package/dist/src/gallery.d.ts +55 -0
  63. package/dist/src/gallery.js +129 -0
  64. package/dist/src/heading.d.ts +72 -0
  65. package/dist/src/heading.js +128 -0
  66. package/dist/src/hidden.d.ts +21 -0
  67. package/dist/src/hidden.js +23 -0
  68. package/dist/src/html.d.ts +104 -0
  69. package/dist/src/html.js +231 -0
  70. package/dist/src/imageParameter.d.ts +66 -0
  71. package/dist/src/imageParameter.js +246 -0
  72. package/dist/src/imagemap.d.ts +57 -0
  73. package/dist/src/imagemap.js +148 -0
  74. package/dist/src/imagemapLink.d.ts +57 -0
  75. package/dist/src/imagemapLink.js +40 -0
  76. package/dist/src/index.d.ts +145 -0
  77. package/dist/src/index.js +766 -0
  78. package/dist/src/link/base.d.ts +52 -0
  79. package/dist/src/link/base.js +207 -0
  80. package/dist/src/link/category.d.ts +13 -0
  81. package/dist/src/link/category.js +29 -0
  82. package/dist/src/link/file.d.ts +96 -0
  83. package/dist/src/link/file.js +253 -0
  84. package/dist/src/link/galleryImage.d.ts +43 -0
  85. package/dist/src/link/galleryImage.js +106 -0
  86. package/dist/src/link/index.d.ts +53 -0
  87. package/dist/src/link/index.js +123 -0
  88. package/dist/src/magicLink.d.ts +58 -0
  89. package/dist/src/magicLink.js +122 -0
  90. package/dist/src/nested.d.ts +44 -0
  91. package/dist/src/nested.js +87 -0
  92. package/dist/src/nowiki/base.d.ts +46 -0
  93. package/dist/src/nowiki/base.js +42 -0
  94. package/dist/src/nowiki/comment.d.ts +39 -0
  95. package/dist/src/nowiki/comment.js +67 -0
  96. package/dist/src/nowiki/dd.d.ts +8 -0
  97. package/dist/src/nowiki/dd.js +25 -0
  98. package/dist/src/nowiki/doubleUnderscore.d.ts +43 -0
  99. package/dist/src/nowiki/doubleUnderscore.js +51 -0
  100. package/dist/src/nowiki/hr.d.ts +29 -0
  101. package/dist/src/nowiki/hr.js +14 -0
  102. package/dist/src/nowiki/index.d.ts +16 -0
  103. package/dist/src/nowiki/index.js +21 -0
  104. package/dist/src/nowiki/list.d.ts +29 -0
  105. package/dist/src/nowiki/list.js +48 -0
  106. package/dist/src/nowiki/listBase.d.ts +18 -0
  107. package/dist/src/nowiki/listBase.js +12 -0
  108. package/dist/src/nowiki/noinclude.d.ts +25 -0
  109. package/dist/src/nowiki/noinclude.js +25 -0
  110. package/dist/src/nowiki/quote.d.ts +22 -0
  111. package/dist/src/nowiki/quote.js +50 -0
  112. package/dist/src/onlyinclude.d.ts +16 -0
  113. package/dist/src/onlyinclude.js +57 -0
  114. package/dist/src/paramTag/index.d.ts +37 -0
  115. package/dist/src/paramTag/index.js +68 -0
  116. package/dist/src/paramTag/inputbox.d.ts +8 -0
  117. package/dist/src/paramTag/inputbox.js +23 -0
  118. package/dist/src/parameter.d.ts +82 -0
  119. package/dist/src/parameter.js +198 -0
  120. package/dist/src/pre.d.ts +28 -0
  121. package/dist/src/pre.js +51 -0
  122. package/dist/src/syntax.d.ts +25 -0
  123. package/dist/src/syntax.js +30 -0
  124. package/dist/src/table/base.d.ts +52 -0
  125. package/dist/src/table/base.js +78 -0
  126. package/dist/src/table/index.d.ts +229 -0
  127. package/dist/src/table/index.js +379 -0
  128. package/dist/src/table/td.d.ts +102 -0
  129. package/dist/src/table/td.js +261 -0
  130. package/dist/src/table/tr.d.ts +32 -0
  131. package/dist/src/table/tr.js +56 -0
  132. package/dist/src/table/trBase.d.ts +54 -0
  133. package/dist/src/table/trBase.js +151 -0
  134. package/dist/src/tagPair/ext.d.ts +55 -0
  135. package/dist/src/tagPair/ext.js +142 -0
  136. package/dist/src/tagPair/include.d.ts +52 -0
  137. package/dist/src/tagPair/include.js +58 -0
  138. package/dist/src/tagPair/index.d.ts +47 -0
  139. package/dist/src/tagPair/index.js +93 -0
  140. package/dist/src/transclude.d.ts +167 -0
  141. package/dist/src/transclude.js +689 -0
  142. package/dist/util/constants.js +107 -0
  143. package/dist/util/debug.js +62 -0
  144. package/dist/util/diff.js +72 -0
  145. package/dist/util/lint.js +48 -0
  146. package/dist/util/string.js +61 -0
  147. package/errors/README +1 -0
  148. package/package.json +11 -23
  149. package/printed/README +1 -0
  150. package/bundle/bundle.min.js +0 -36
  151. package/extensions/dist/base.js +0 -70
  152. package/extensions/dist/editor.js +0 -172
  153. package/extensions/dist/highlight.js +0 -39
  154. package/extensions/dist/lint.js +0 -48
  155. package/extensions/editor.css +0 -63
  156. package/extensions/ui.css +0 -119
package/README.en.md CHANGED
@@ -16,7 +16,7 @@ wikiparser-node is an offline [Wikitext](https://www.mediawiki.org/wiki/Wikitext
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
 
19
- ## Browser
19
+ ## Browser-compatible
20
20
 
21
21
  A browser-compatible version, which can be used for code highlighting or as a linting plugin in conjunction with the [CodeMirror5](https://codemirror.net/5/) editor. ([Usage example](https://bhsd-harry.github.io/wikiparser-node))
22
22
 
package/README.md CHANGED
@@ -16,7 +16,7 @@ wikiparser-node 是一款由 Bhsd 开发的基于 [Node.js](https://nodejs.org/)
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
 
19
- ## Browser
19
+ ## Browser-compatible
20
20
 
21
21
  兼容浏览器的版本,可用于代码高亮或是搭配 [CodeMirror5](https://codemirror.net/5/) 编辑器作为语法分析插件。([使用实例展示](https://bhsd-harry.github.io/wikiparser-node))
22
22
 
@@ -0,0 +1,160 @@
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
+ "required": [
34
+ "6",
35
+ "10"
36
+ ],
37
+ "additionalProperties": false
38
+ },
39
+ "nsid": {
40
+ "description": "namespace IDs",
41
+ "type": "object",
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
+ "items": {
60
+ "type": "string"
61
+ }
62
+ },
63
+ {
64
+ "description": "msg and raw",
65
+ "type": "array",
66
+ "items": {
67
+ "type": "string"
68
+ }
69
+ },
70
+ {
71
+ "description": "subst and safesubst",
72
+ "type": "array",
73
+ "items": {
74
+ "type": "string"
75
+ }
76
+ }
77
+ ],
78
+ "minItems": 4,
79
+ "maxItems": 4
80
+ },
81
+ "doubleUnderscore": {
82
+ "description": "behavior switches",
83
+ "type": "array",
84
+ "items": {
85
+ "type": "array",
86
+ "items": {
87
+ "type": "string"
88
+ }
89
+ },
90
+ "minItems": 2,
91
+ "maxItems": 2
92
+ },
93
+ "protocol": {
94
+ "description": "external link protocols",
95
+ "type": "string",
96
+ "pattern": "^[a-z:/]+(?:\\|[a-z:/]+)*$"
97
+ },
98
+ "interwiki": {
99
+ "type": "array",
100
+ "items": {
101
+ "type": "string"
102
+ }
103
+ },
104
+ "img": {
105
+ "description": "image-related magic words",
106
+ "type": "object",
107
+ "additionalProperties": {
108
+ "type": "string",
109
+ "pattern": "^[-a-z]+$"
110
+ }
111
+ },
112
+ "variants": {
113
+ "description": "variants for language conversion",
114
+ "type": "array",
115
+ "items": {
116
+ "type": "string",
117
+ "pattern": "^[-a-z]+$"
118
+ }
119
+ },
120
+ "conversionTable": {
121
+ "description": "table of unidirectional conversions",
122
+ "type": "array",
123
+ "items": {
124
+ "type": "array",
125
+ "items": {
126
+ "type": "string",
127
+ "pattern": "^[^ <>[\\]{}|]+$"
128
+ },
129
+ "minItems": 2,
130
+ "maxItems": 2
131
+ }
132
+ },
133
+ "redirects": {
134
+ "description": "table of redirects",
135
+ "type": "array",
136
+ "items": {
137
+ "type": "array",
138
+ "items": {
139
+ "type": "string",
140
+ "pattern": "^[^ <>[\\]{}|]+$"
141
+ },
142
+ "minItems": 2,
143
+ "maxItems": 2
144
+ }
145
+ }
146
+ },
147
+ "required": [
148
+ "ext",
149
+ "html",
150
+ "namespaces",
151
+ "nsid",
152
+ "parserFunction",
153
+ "doubleUnderscore",
154
+ "protocol",
155
+ "interwiki",
156
+ "img",
157
+ "variants"
158
+ ],
159
+ "additionalProperties": false
160
+ }
@@ -518,7 +518,41 @@
518
518
  ]
519
519
  ],
520
520
  "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
- "interwiki": [],
521
+ "interwiki": [
522
+ "arxiv",
523
+ "aswiki",
524
+ "cache",
525
+ "cmoegirl",
526
+ "commons",
527
+ "doi",
528
+ "google",
529
+ "googlegroups",
530
+ "gsnews",
531
+ "imdb",
532
+ "jawiki",
533
+ "komica",
534
+ "mediawikiwiki",
535
+ "metawikimedia",
536
+ "moegirl",
537
+ "mw",
538
+ "sifaswiki",
539
+ "sifwiki",
540
+ "wikia",
541
+ "wikibooks",
542
+ "wikidata",
543
+ "wikimedia",
544
+ "wikinews",
545
+ "wikiinfo",
546
+ "wikipedia",
547
+ "wikiquote",
548
+ "wikisource",
549
+ "wikispecies",
550
+ "wikiversity",
551
+ "wikivoyage",
552
+ "wikt",
553
+ "wiktionary",
554
+ "zhwiki"
555
+ ],
522
556
  "img": {
523
557
  "thumbnail": "thumbnail",
524
558
  "thumb": "thumbnail",
@@ -611,7 +611,50 @@
611
611
  ]
612
612
  ],
613
613
  "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:",
614
- "interwiki": [],
614
+ "interwiki": [
615
+ "commons",
616
+ "mediawikiwiki",
617
+ "metawikimedia",
618
+ "mw",
619
+ "wikibooks",
620
+ "wikidata",
621
+ "wikimedia",
622
+ "wikinews",
623
+ "wikipedia",
624
+ "wikiquote",
625
+ "wikisource",
626
+ "wikispecies",
627
+ "wikiversity",
628
+ "wikivoyage",
629
+ "wikt",
630
+ "wiktionary",
631
+ "cc",
632
+ "cm",
633
+ "en",
634
+ "enmoe",
635
+ "enwp",
636
+ "fandom",
637
+ "ghia",
638
+ "huiji",
639
+ "ja",
640
+ "jamoe",
641
+ "jawp",
642
+ "library",
643
+ "meta",
644
+ "phab",
645
+ "pmid",
646
+ "shoutwiki",
647
+ "translatewiki",
648
+ "zh",
649
+ "zhmoe",
650
+ "zhmoegirl",
651
+ "zhtest",
652
+ "zhwp",
653
+ "文库",
654
+ "萌娘共享",
655
+ "萌娘文库",
656
+ "萌百"
657
+ ],
615
658
  "img": {
616
659
  "thumbnail": "thumbnail",
617
660
  "thumb": "thumbnail",