A Python parser for MediaWiki wikicode https://mwparserfromhell.readthedocs.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

пре 1 година
пре 1 година
пре 1 година
пре 11 месеци
пре 1 година
пре 1 година
пре 1 година
пре 2 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 4 година
пре 3 година
пре 4 година
пре 4 година
пре 4 година
пре 5 година
пре 5 година
пре 5 година
пре 5 година
пре 6 година
пре 6 година
пре 6 година
пре 7 година
пре 7 година
пре 7 година
пре 8 година
пре 8 година
пре 8 година
пре 9 година
пре 8 година
пре 9 година
пре 8 година
пре 9 година
пре 9 година
пре 9 година
пре 9 година
пре 9 година
пре 10 година
пре 9 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. v0.6.6 (unreleased):
  2. - Dropped support for end-of-life Python 3.7.
  3. - Added support for Python 3.12.
  4. - Raised nested node depth limit from 40 to 100 to match current MediaWiki. (#313)
  5. v0.6.5 (released September 5, 2023):
  6. - Dropped support for end-of-life Python 3.6.
  7. - Added support for Python 3.11.
  8. - Fixed parsing of leading zeros in named HTML entities. (#288)
  9. - Fixed memory leak parsing tags. (#303)
  10. - Fixed pickling SmartList objects. (#289)
  11. v0.6.4 (released February 14, 2022):
  12. - Dropped support for end-of-life Python 3.5.
  13. - Added support for Python 3.10. (#278)
  14. - Fixed a regression in v0.6.2 that broke parsing of nested wikilinks in file
  15. captions. For now, the parser will interpret nested wikilinks in normal links
  16. as well, even though this differs from MediaWiki. (#270)
  17. v0.6.3 (released September 2, 2021):
  18. - Added Linux AArch64 wheels. (#276)
  19. - Fixed C integer conversion, manifesting as parsing errors on big-endian
  20. platforms. (#277)
  21. v0.6.2 (released May 16, 2021):
  22. - Improved parsing of external links. (#232)
  23. - Fixed parsing of nested wikilinks.
  24. - Ported tests to pytest. (#237)
  25. - Moved mwparserfromhell package to src/ dir.
  26. - There was no 0.6.1 release due to a packaging error.
  27. v0.6 (released December 21, 2020):
  28. Thanks to everyone for their patience with this release!
  29. - Breaking change: dropped support for end-of-life Python 2.7 and 3.4.
  30. - Added support for Python 3.8 and 3.9.
  31. - Added binary wheels for Linux and macOS.
  32. - Updated Wikicode.matches() to recognize underscores as being equivalent
  33. to spaces. (#216)
  34. - Added a 'default' parameter to Template.get(), and implement dict-style item
  35. access for template parameters. (#252)
  36. - Fixed a rare parsing bug involving deeply nested style tags. (#224)
  37. - Fixed parsing of section headings inside templates. (#233)
  38. - Updated HTML tag definitions.
  39. - Internal refactoring and cleanup.
  40. v0.5.4 (released May 15, 2019):
  41. - Fixed an unlikely crash in the C tokenizer when interrupted while parsing
  42. a heading.
  43. v0.5.3 (released March 30, 2019):
  44. - Fixed manual construction of Node objects, previously unsupported. (#214)
  45. - Fixed Wikicode transformation methods (replace(), remove(), etc.) when passed
  46. an empty section as an argument. (#212)
  47. - Fixed the parser getting stuck inside malformed tables. (#206)
  48. v0.5.2 (released November 1, 2018):
  49. - Dropped support for end-of-life Python versions 2.6, 3.2, 3.3. (#199, #204)
  50. - Fixed signals getting stuck inside the C tokenizer until parsing finishes,
  51. in pathological cases. (#206)
  52. - Fixed <wbr> not being considered a single-only tag. (#200)
  53. - Fixed a C tokenizer crash on Python 3.7 when compiled with assertions. (#208)
  54. - Cleaned up some minor documentation issues. (#207)
  55. v0.5.1 (released March 3, 2018):
  56. - Improved behavior when adding parameters to templates (via Template.add())
  57. with poorly formatted whitespace conventions. (#185)
  58. - Fixed the parser getting stuck in deeply nested HTML tags with unclosed,
  59. quoted attributes. (#190)
  60. v0.5 (released June 23, 2017):
  61. - Added Wikicode.contains() to determine whether a Node or Wikicode object is
  62. contained within another Wikicode object.
  63. - Added Wikicode.get_ancestors() and Wikicode.get_parent() to find all
  64. ancestors and the direct parent of a Node, respectively.
  65. - Fixed a long-standing performance issue with deeply nested, invalid syntax
  66. (issue #42). The parser should be much faster on certain complex pages. The
  67. "max cycle" restriction has also been removed, so some situations where
  68. templates at the end of a page were being skipped are now resolved.
  69. - Made Template.remove(keep_field=True) behave more reasonably when the
  70. parameter is already empty.
  71. - Added the keep_template_params argument to Wikicode.strip_code(). If True,
  72. then template parameters will be preserved in the output.
  73. - Wikicode objects can now be pickled properly (fixed infinite recursion error
  74. on incompletely-constructed StringMixIn subclasses).
  75. - Fixed Wikicode.matches()'s behavior on iterables besides lists and tuples.
  76. - Fixed len() sometimes raising ValueError on empty node lists.
  77. - Fixed a rare parsing bug involving self-closing tags inside the attributes of
  78. unpaired tags.
  79. - Fixed release script after changes to PyPI.
  80. v0.4.4 (released December 30, 2016):
  81. - Added support for Python 3.6.
  82. - Fixed parsing bugs involving:
  83. - wikitables nested in templates;
  84. - wikitable error recovery when unable to recurse;
  85. - templates nested in template parameters before other parameters.
  86. - Fixed parsing file-like objects.
  87. - Made builds deterministic.
  88. - Documented caveats.
  89. v0.4.3 (released October 29, 2015):
  90. - Added Windows binaries for Python 3.5.
  91. - Fixed edge cases involving wikilinks inside of external links and vice versa.
  92. - Fixed a C tokenizer crash when a keyboard interrupt happens while parsing.
  93. v0.4.2 (released July 30, 2015):
  94. - Fixed setup script not including header files in releases.
  95. - Fixed Windows binary uploads.
  96. v0.4.1 (released July 30, 2015):
  97. - The process for building Windows binaries has been fixed, and these should be
  98. distributed along with new releases. Windows users can now take advantage of
  99. C speedups without having a compiler of their own.
  100. - Added support for Python 3.5.
  101. - '<' and '>' are now disallowed in wikilink titles and template names. This
  102. includes when denoting tags, but not comments.
  103. - Fixed the behavior of preserve_spacing in Template.add() and keep_field in
  104. Template.remove() on parameters with hidden keys.
  105. - Removed _ListProxy.detach(). SmartLists now use weak references and their
  106. children are garbage-collected properly.
  107. - Fixed parser bugs involving:
  108. - templates with completely blank names;
  109. - templates with newlines and comments.
  110. - Heavy refactoring and fixes to the C tokenizer, including:
  111. - corrected a design flaw in text handling, allowing for substantial speed
  112. improvements when parsing long strings of plain text;
  113. - implemented new Python 3.3 PEP 393 Unicode APIs.
  114. - Fixed various bugs in SmartList, including one that was causing memory issues
  115. on 64-bit builds of Python 2 on Windows.
  116. - Fixed some bugs in the release scripts.
  117. v0.4 (released May 23, 2015):
  118. - The parser now falls back on pure Python mode if C extensions cannot be
  119. built. This fixes an issue that prevented some Windows users from installing
  120. the parser.
  121. - Added support for parsing wikicode tables (patches by David Winegar).
  122. - Added a script to test for memory leaks in scripts/memtest.py.
  123. - Added a script to do releases in scripts/release.sh.
  124. - skip_style_tags can now be passed to mwparserfromhell.parse() (previously,
  125. only Parser().parse() allowed it).
  126. - The 'recursive' argument to Wikicode's filter methods now accepts a third
  127. option, RECURSE_OTHERS, which recurses over all children except instances of
  128. 'forcetype' (for example, `code.filter_templates(code.RECURSE_OTHERS)`
  129. returns all un-nested templates).
  130. - The parser now understands HTML tag attributes quoted with single quotes.
  131. When setting a tag attribute's value, quotes will be added if necessary. As
  132. part of this, Attribute's 'quoted' attribute has been changed to 'quotes',
  133. and is now either a string or None.
  134. - Calling Template.remove() with a Parameter object that is not part of the
  135. template now raises ValueError instead of doing nothing.
  136. - Parameters with non-integer keys can no longer be created with
  137. 'showkey=False', nor have the value of this attribute be set to False later.
  138. - _ListProxy.destroy() has been changed to _ListProxy.detach(), and now works
  139. in a more useful way.
  140. - If something goes wrong while parsing, ParserError will now be raised.
  141. Previously, the parser would produce an unclear BadRoute exception or allow
  142. an incorrect node tree to be build.
  143. - Fixed parser bugs involving:
  144. - nested tags;
  145. - comments in template names;
  146. - tags inside of <nowiki> tags.
  147. - Added tests to ensure that parsed trees convert back to wikicode without
  148. unintentional modifications.
  149. - Added support for a NOWEB environment variable, which disables a unit test
  150. that makes a web call.
  151. - Test coverage has been improved, and some minor related bugs have been fixed.
  152. - Updated and fixed some documentation.
  153. v0.3.3 (released April 22, 2014):
  154. - Added support for Python 2.6 and 3.4.
  155. - Template.has() is now passed 'ignore_empty=False' by default instead of True.
  156. This fixes a bug when adding parameters to templates with empty fields, and
  157. is a breaking change if you rely on the default behavior.
  158. - The 'matches' argument of Wikicode's filter methods now accepts a function
  159. (taking one argument, a Node, and returning a bool) in addition to a regex.
  160. - Re-added 'flat' argument to Wikicode.get_sections(), fixed the order in which
  161. it returns sections, and made it faster.
  162. - Wikicode.matches() now accepts a tuple or list of strings/Wikicode objects
  163. instead of just a single string or Wikicode.
  164. - Given the frequency of issues with the (admittedly insufficient) tag parser,
  165. there's a temporary skip_style_tags argument to parse() that ignores '' and
  166. ''' until these issues are corrected.
  167. - Fixed a parser bug involving nested wikilinks and external links.
  168. - C code cleanup and speed improvements.
  169. v0.3.2 (released September 1, 2013):
  170. - Added support for Python 3.2 (along with current support for 3.3 and 2.7).
  171. - Renamed Template.remove()'s first argument from 'name' to 'param', which now
  172. accepts Parameter objects in addition to parameter name strings.
  173. v0.3.1 (released August 29, 2013):
  174. - Fixed a parser bug involving URLs nested inside other markup.
  175. - Fixed some typos.
  176. v0.3 (released August 24, 2013):
  177. - Added complete support for HTML Tags, including forms like <ref>foo</ref>,
  178. <ref name="bar"/>, and wiki-markup tags like bold ('''), italics (''), and
  179. lists (*, #, ; and :).
  180. - Added support for ExternalLinks (http://example.com/ and
  181. [http://example.com/ Example]).
  182. - Wikicode's filter methods are now passed 'recursive=True' by default instead
  183. of False. This is a breaking change if you rely on any filter() methods being
  184. non-recursive by default.
  185. - Added a matches() method to Wikicode for page/template name comparisons.
  186. - The 'obj' param of Wikicode.insert_before(), insert_after(), replace(), and
  187. remove() now accepts other Wikicode objects and strings representing parts of
  188. wikitext, instead of just nodes. These methods also make all possible
  189. substitutions instead of just one.
  190. - Renamed Template.has_param() to has() for consistency with Template's other
  191. methods; has_param() is now an alias.
  192. - The C tokenizer extension now works on Python 3 in addition to Python 2.7.
  193. - Various bugfixes, internal changes, and cleanup.
  194. v0.2 (released June 20, 2013):
  195. - The parser now fully supports Python 3 in addition to Python 2.7.
  196. - Added a C tokenizer extension that is significantly faster than its Python
  197. equivalent. It is enabled by default (if available) and can be toggled by
  198. setting `mwparserfromhell.parser.use_c` to a boolean value.
  199. - Added a complete set of unit tests covering parsing and wikicode
  200. manipulation.
  201. - Renamed Wikicode.filter_links() to filter_wikilinks() (applies to ifilter as
  202. well).
  203. - Added filter methods for Arguments, Comments, Headings, and HTMLEntities.
  204. - Added 'before' param to Template.add(); renamed 'force_nonconformity' to
  205. 'preserve_spacing'.
  206. - Added 'include_lead' param to Wikicode.get_sections().
  207. - Removed 'flat' param from Wikicode.get_sections().
  208. - Removed 'force_no_field' param from Template.remove().
  209. - Added support for Travis CI.
  210. - Added note about Windows build issue in the README.
  211. - The tokenizer will limit itself to a realistic recursion depth to prevent
  212. errors and unreasonably long parse times.
  213. - Fixed how some nodes' attribute setters handle input.
  214. - Fixed multiple bugs in the tokenizer's handling of invalid markup.
  215. - Fixed bugs in the implementation of SmartList and StringMixIn.
  216. - Fixed some broken example code in the README; other copyedits.
  217. - Other bugfixes and code cleanup.
  218. v0.1.1 (released September 21, 2012):
  219. - Added support for Comments (<!-- foo -->) and Wikilinks ([[foo]]).
  220. - Added corresponding ifilter_links() and filter_links() methods to Wikicode.
  221. - Fixed a bug when parsing incomplete templates.
  222. - Fixed strip_code() to affect the contents of headings.
  223. - Various copyedits in documentation and comments.
  224. v0.1 (released August 23, 2012):
  225. - Initial release.