wikiparser-node 1.21.0 → 1.21.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 (78) hide show
  1. package/README.md +42 -7
  2. package/bundle/bundle-es8.min.js +24 -24
  3. package/bundle/bundle-lsp.min.js +25 -25
  4. package/bundle/bundle.min.js +24 -24
  5. package/config/default.json +1 -0
  6. package/config/minimum.json +1 -0
  7. package/config/moegirl.json +1 -0
  8. package/coverage/badge.svg +1 -1
  9. package/dist/addon/table.js +5 -5
  10. package/dist/addon/token.js +129 -12
  11. package/dist/bin/config.js +3 -3
  12. package/dist/index.d.ts +7 -0
  13. package/dist/lib/attributes.js +1 -2
  14. package/dist/lib/element.d.ts +1 -0
  15. package/dist/lib/element.js +8 -4
  16. package/dist/lib/lsp.d.ts +2 -0
  17. package/dist/lib/lsp.js +5 -4
  18. package/dist/lib/node.d.ts +20 -3
  19. package/dist/lib/node.js +39 -17
  20. package/dist/lib/text.d.ts +2 -0
  21. package/dist/lib/text.js +17 -12
  22. package/dist/lib/title.d.ts +3 -1
  23. package/dist/lib/title.js +3 -1
  24. package/dist/mixin/sol.js +1 -1
  25. package/dist/parser/list.js +8 -5
  26. package/dist/parser/table.js +2 -2
  27. package/dist/src/arg.js +1 -1
  28. package/dist/src/atom.js +10 -0
  29. package/dist/src/attribute.d.ts +1 -0
  30. package/dist/src/attribute.js +53 -17
  31. package/dist/src/attributes.js +19 -9
  32. package/dist/src/converter.js +1 -1
  33. package/dist/src/converterFlags.js +14 -5
  34. package/dist/src/extLink.js +2 -2
  35. package/dist/src/gallery.d.ts +12 -2
  36. package/dist/src/gallery.js +12 -2
  37. package/dist/src/heading.d.ts +6 -1
  38. package/dist/src/heading.js +14 -4
  39. package/dist/src/hidden.js +7 -1
  40. package/dist/src/html.js +12 -5
  41. package/dist/src/imageParameter.d.ts +1 -0
  42. package/dist/src/imageParameter.js +9 -3
  43. package/dist/src/imagemap.js +9 -4
  44. package/dist/src/index.d.ts +3 -0
  45. package/dist/src/index.js +25 -5
  46. package/dist/src/link/base.js +4 -4
  47. package/dist/src/link/file.d.ts +9 -1
  48. package/dist/src/link/file.js +13 -5
  49. package/dist/src/link/galleryImage.d.ts +1 -0
  50. package/dist/src/link/galleryImage.js +19 -6
  51. package/dist/src/link/redirectTarget.d.ts +6 -1
  52. package/dist/src/link/redirectTarget.js +7 -2
  53. package/dist/src/magicLink.d.ts +6 -1
  54. package/dist/src/magicLink.js +31 -12
  55. package/dist/src/nested.js +1 -1
  56. package/dist/src/nowiki/comment.js +1 -1
  57. package/dist/src/nowiki/index.d.ts +1 -0
  58. package/dist/src/nowiki/index.js +13 -3
  59. package/dist/src/nowiki/listBase.d.ts +6 -1
  60. package/dist/src/nowiki/listBase.js +7 -2
  61. package/dist/src/nowiki/quote.d.ts +6 -1
  62. package/dist/src/nowiki/quote.js +9 -2
  63. package/dist/src/parameter.js +1 -1
  64. package/dist/src/redirect.js +1 -1
  65. package/dist/src/table/index.js +8 -7
  66. package/dist/src/table/td.js +1 -1
  67. package/dist/src/table/trBase.d.ts +1 -1
  68. package/dist/src/table/trBase.js +3 -31
  69. package/dist/src/tagPair/ext.js +5 -2
  70. package/dist/src/transclude.d.ts +21 -8
  71. package/dist/src/transclude.js +48 -26
  72. package/dist/util/html.js +3 -6
  73. package/dist/util/lint.js +33 -1
  74. package/extensions/dist/base.js +1 -1
  75. package/extensions/ui.css +1 -1
  76. package/i18n/zh-hans.json +1 -1
  77. package/i18n/zh-hant.json +1 -1
  78. package/package.json +7 -13
package/README.md CHANGED
@@ -87,17 +87,52 @@ A full database dump (`*.xml.bz2`) scan of Chinese Wikipedia's ~3.5 million arti
87
87
  ## Parser
88
88
 
89
89
  1. Memory leaks may occur in rare cases.
90
+ 1. Invalid page names with unicode characters are treated like valid ones ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Render%20invalid%20page%20names%20as%20plain%20text%20(T53090))).
90
91
  1. Preformatted text with a leading space is only processed by [`Token.prototype.toHtml`](https://github.com/bhsd-harry/wikiparser-node/wiki/Token-%28EN%29#tohtml).
91
- 1. Invalid page name with unicode characters ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Render%20invalid%20page%20names%20as%20plain%20text%20(T53090))).
92
92
 
93
93
  ## HTML conversion
94
94
 
95
+ ### Extension
96
+
95
97
  1. Many extensions are not supported, such as `<indicator>` and `<ref>`.
98
+
99
+ ### Transclusion
100
+
96
101
  1. Most parser functions are not supported.
97
- 1. TOC is not supported.
102
+ 1. Transclusion of a subpage is not supported ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#T2561%3A%20%7B%7B%2FSubpage%7D%7D)).
103
+
104
+ ### Heading
105
+
106
+ 1. HTML section heading elements are not automatically given an `id` attribute ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Do%20not%20trim%20whitespace%20in%20HTML%20headings%2C%20list%20items%2C%20table%20captions%2C%20headings%2C%20and%20cells)).
107
+ 1. The table of contents (TOC) is not supported.
108
+
109
+ ### HTML tag
110
+
111
+ 1. Style sanitization is sometimes different ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#CSS%20safety%20test%20(all%20browsers)%3A%20vertical%20tab%20(T57332%20%2F%20CVE-2013-4567))).
112
+
113
+ ### Table
114
+
115
+ 1. `<caption>` elements are wrapped in `<tbody>` elements ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Trim%20whitespace%20in%20wikitext%20headings%2C%20list%20items%2C%20table%20captions%2C%20headings%2C%20and%20cells)).
116
+ 1. Missing newline between the fostered content and the table ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Templates%3A%20Wiki%20Tables%3A%201a.%20Fostering%20of%20entire%20template%20content)).
117
+ 1. Unclosed HTML tags in the table fostered content ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Fuzz%20testing%3A%20Parser24)).
118
+ 1. `<tr>` elements should not be fostered ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Empty%20TR%20followed%20by%20a%20template-generated%20TR)).
119
+
120
+ ### Link
121
+
98
122
  1. Link trail is not supported ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#1.%20Interaction%20of%20linktrail%20and%20template%20encapsulation)).
99
- 1. Incomplete `<p>` wrapping (Examples [1](http://bhsd-harry.github.io/wikiparser-node/tests.html#%3Cpre%3E%20inside%20a%20link), [2](http://bhsd-harry.github.io/wikiparser-node/tests.html#Templates%3A%20Scopes%20should%20not%20be%20expanded%20unnecessarily)).
100
- 1. URI encoding in free external links ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Parsoid%3A%20pipe%20in%20transclusion%20parameter)).
101
- 1. When the entire table content is fostered, the table does not have an empty `<td>` (Examples [1](http://bhsd-harry.github.io/wikiparser-node/tests.html#Templates%3A%20Wiki%20Tables%3A%201a.%20Fostering%20of%20entire%20template%20content), [2](http://bhsd-harry.github.io/wikiparser-node/tests.html#Templates%3A%20Wiki%20Tables%3A%201b.%20Fostering%20of%20entire%20template%20content), [3](http://bhsd-harry.github.io/wikiparser-node/tests.html#Templates%3A%20Wiki%20Tables%3A%202.%20Fostering%20of%20partial%20template%20content), [4](http://bhsd-harry.github.io/wikiparser-node/tests.html#Templates%3A%20Wiki%20Tables%3A%204.%20Templated%20tags%2C%20no%20content)).
102
- 1. Link to a subpage without a slash ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Subpage%20noslash%20link)).
103
- 1. Transclusion of a subpage ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#T2561%3A%20%7B%7B%2FSubpage%7D%7D)).
123
+ 1. Links to a subpage without a slash are not supported ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Subpage%20noslash%20link)).
124
+ 1. Block elements inside a link should break it into multiple links ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#%3Cpre%3E%20inside%20a%20link)).
125
+
126
+ ### External link
127
+
128
+ 1. External images are not supported ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#T21052%20U%2B3000%20IDEOGRAPHIC%20SPACE%20should%20terminate%20external%20images%20links)).
129
+ 1. No percent-encoding in displayed free external links ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Parsoid%3A%20pipe%20in%20transclusion%20parameter)).
130
+
131
+ ### Block element
132
+
133
+ 1. Incomplete `<p>` wrapping when there are block elements (e.g., [`<pre>`](http://bhsd-harry.github.io/wikiparser-node/tests.html#%3Cpre%3E%20inside%20a%20link), [`<div>`](http://bhsd-harry.github.io/wikiparser-node/tests.html#Templates%3A%20Scopes%20should%20not%20be%20expanded%20unnecessarily) or even [closing tags](http://bhsd-harry.github.io/wikiparser-node/tests.html#Non-word%20characters%20don't%20terminate%20tag%20names%20(T19663%2C%20T42670%2C%20T54022))).
134
+ 1. Mixed lists ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Mixed%20Lists%3A%20Test%204)).
135
+
136
+ ### Miscellaneous
137
+
138
+ 1. Illegal HTML entities ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Illegal%20character%20references%20(T106578%2C%20T113194))).