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.
 
 
 
 

196 regels
9.2 KiB

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