A Python parser for MediaWiki wikicode https://mwparserfromhell.readthedocs.io/
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

203 Zeilen
9.5 KiB

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