A Python parser for MediaWiki wikicode https://mwparserfromhell.readthedocs.io/
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

CHANGELOG 10 KiB

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