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.
 
 
 
 

242 lines
11 KiB

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