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.

204 lines
9.6KB

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