wikiparser-node 1.43.0 → 1.44.0

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 (43) hide show
  1. package/README.md +10 -7
  2. package/bundle/bundle-es8.min.js +40 -31
  3. package/bundle/bundle-lsp.min.js +35 -26
  4. package/bundle/bundle.min.js +22 -22
  5. package/config/default.json +31 -0
  6. package/config/moegirl.json +39 -1
  7. package/dist/base.d.mts +4 -4
  8. package/dist/base.d.ts +4 -4
  9. package/dist/base.js +1 -0
  10. package/dist/base.mjs +1 -0
  11. package/dist/bin/config.js +6 -5
  12. package/dist/index.js +8 -5
  13. package/dist/lib/document.d.ts +17 -14
  14. package/dist/lib/lintConfig.js +4 -1
  15. package/dist/lib/title.d.ts +4 -1
  16. package/dist/lib/title.js +5 -1
  17. package/dist/mixin/attributesParent.js +1 -1
  18. package/dist/parser/converter.js +1 -1
  19. package/dist/render/extension.js +30 -24
  20. package/dist/render/magicWords.js +1 -1
  21. package/dist/render/math.js +31 -0
  22. package/dist/render/syntaxhighlight.js +3 -0
  23. package/dist/src/attributes.d.ts +1 -0
  24. package/dist/src/attributes.js +27 -3
  25. package/dist/src/converterFlags.js +10 -5
  26. package/dist/src/converterRule.js +2 -2
  27. package/dist/src/imageParameter.d.ts +4 -3
  28. package/dist/src/imageParameter.js +15 -7
  29. package/dist/src/link/file.d.ts +5 -4
  30. package/dist/src/link/file.js +12 -9
  31. package/dist/src/nowiki/index.d.ts +1 -0
  32. package/dist/src/nowiki/index.js +40 -28
  33. package/dist/src/tagPair/ext.d.ts +1 -0
  34. package/dist/src/tagPair/ext.js +36 -3
  35. package/dist/src/transclude.js +1 -1
  36. package/dist/util/search.js +24 -6
  37. package/dist/util/string.js +7 -1
  38. package/extensions/dist/base.js +1 -1
  39. package/extensions/dist/codejar.js +1 -1
  40. package/i18n/en.json +7 -0
  41. package/i18n/zh-hans.json +7 -0
  42. package/i18n/zh-hant.json +7 -0
  43. package/package.json +19 -12
package/README.md CHANGED
@@ -77,11 +77,12 @@ You can install any of the following optional packages to enable advanced featur
77
77
 
78
78
  | Package | Purpose |
79
79
  | :-: | --- |
80
- | `mathoid-texvcjs` | Diagnostics for `<math>` and `<chem>` extension tags |
80
+ | `mathoid-texvcjs` | Diagnostics and HTML conversion support for `<math>` and `<chem>` extension tags |
81
81
  | `stylelint` | Diagnostics for `style` attributes |
82
82
  | `vscode-css-languageservice` | CSS language support for `style` attributes |
83
83
  | `vscode-html-languageservice` | Language support for HTML tags |
84
- | `vscode-json-languageservice` | JSON language support for `<templatedata>`, `<mapframe>`, `<maplink>` tags |
84
+ | `vscode-json-languageservice` | JSON language support for `<templatedata>`, `<mapframe>` and `<maplink>` tags |
85
+ | `katex` | HTML conversion support for `<math>` and `<chem>` extension tags |
85
86
  | `mediawiki-expr` | Evaluation of parser functions `#expr` and `#ifexpr` |
86
87
  | `prismjs` + `prism-wiki` | Syntax highlighting of `<syntaxhighlight>` extension tags |
87
88
 
@@ -90,7 +91,7 @@ You can install any of the following optional packages to enable advanced featur
90
91
  npm i mathoid-texvcjs stylelint vscode-css-languageservice vscode-html-languageservice vscode-json-languageservice
91
92
 
92
93
  # Full HTML conversion support for `Parser.toHtml()`
93
- npm i mediawiki-expr prismjs prism-wiki
94
+ npm i katex mathoid-texvcjs mediawiki-expr prismjs prism-wiki
94
95
  ```
95
96
 
96
97
  ### Browser
@@ -166,7 +167,6 @@ The following limitations are documented for transparency.
166
167
  1. Memory leaks may occur in rare cases.
167
168
  1. Invalid page names with unicode characters are treated like valid ones ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#Render%20invalid%20page%20names%20as%20plain%20text%20(T53090))).
168
169
  1. Preformatted text with a leading space is only processed by [`Token#toHtml`](https://github.com/bhsd-harry/wikiparser-node/wiki/Token-%28EN%29#tohtml).
169
- 1. BCP 47 language codes are not supported in language conversion ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#Explicit%20definition%20of%20language%20variant%20alternatives%20(BCP%2047%20codes))).
170
170
 
171
171
  ### HTML conversion
172
172
 
@@ -177,6 +177,7 @@ The following limitations are documented for transparency.
177
177
 
178
178
  1. Many [extensions](https://github.com/bhsd-harry/wikiparser-node/wiki/Extensions-%28EN%29#support) are not supported.
179
179
  1. [Sub-referencing](https://meta.wikimedia.org/wiki/WMDE_Technical_Wishes/Sub-referencing) is not supported.
180
+ 1. Special cases involving templates inside the `link` parameter of a gallery image ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#Link%20media%20option%20with%20template%20with%20arguments)).
180
181
 
181
182
  #### Transclusion
182
183
 
@@ -190,7 +191,6 @@ The following limitations are documented for transparency.
190
191
  #### HTML tag
191
192
 
192
193
  1. Style sanitization is sometimes different ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#CSS%20safety%20test%20(all%20browsers)%3A%20vertical%20tab%20(T57332%20%2F%20CVE-2013-4567))).
193
- 1. Table fostered content from `<table>` HTML tags ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#6.%20Encapsulate%20foster-parented%20transclusion%20content)).
194
194
 
195
195
  #### Table
196
196
 
@@ -205,10 +205,13 @@ The following limitations are documented for transparency.
205
205
  1. Block elements inside a link should break it into multiple links ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#%3Cpre%3E%20inside%20a%20link)).
206
206
  1. Invalid or missing images (Examples [1](https://bhsd-harry.github.io/wikiparser-node/tests.html#Fuzz%20testing%3A%20image%20with%20bogus%20manual%20thumbnail), [2](https://bhsd-harry.github.io/wikiparser-node/tests.html#Gallery%20with%20line%20not%20in%20the%20file%20namespace)).
207
207
  1. Link starting with `../` on a subpage ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#Parent%20directory%20in%20redirect)).
208
+ 1. Duplicate file namespace prefixes should be invalid ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#Gallery%20with%20valid%20attributes)).
209
+ 1. File redirects ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#Gallery%20(with%20showfilename%20option))).
210
+ 1. Figure caption should not be nested inside inline elements ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#File%20in%20formatting%20element%20violating%20content%20model%2C%20figcaption%20content)).
211
+ 1. Seemingly broken file link syntax in a table ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#File%20in%20table%20pipe%20precedence)).
208
212
 
209
213
  #### External link
210
214
 
211
- 1. External images are not supported (Examples [1](https://bhsd-harry.github.io/wikiparser-node/tests.html#External%20image), [2](https://bhsd-harry.github.io/wikiparser-node/tests.html#External%20links%3A%20Clickable%20images)).
212
215
  1. No percent-encoding in displayed free external links ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#Parsoid%3A%20pipe%20in%20transclusion%20parameter)).
213
216
 
214
217
  #### Block element
@@ -220,7 +223,7 @@ The following limitations are documented for transparency.
220
223
 
221
224
  1. Automatic language conversion is not supported.
222
225
  1. Support for manual language conversion is minimal ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#Explicit%20session-wise%20one-way%20language%20variant%20mapping%20(A%20flag%20and%20-%20flag))).
223
- 1. BCP 47 language codes are not supported in language conversion ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#Explicit%20definition%20of%20language%20variant%20alternatives%20(BCP%2047%20codes))).
226
+ 1. Language conversion should prevent `<p>` wrapping (Examples [1](https://bhsd-harry.github.io/wikiparser-node/tests.html#Code%20coverage%3A%20rules%20with%20no%20variants), [2](https://bhsd-harry.github.io/wikiparser-node/tests.html#Language%20converter%20markup%20with%20block%20content)).
224
227
 
225
228
  #### Miscellaneous
226
229