A Python parser for MediaWiki wikicode https://mwparserfromhell.readthedocs.io/
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 

199 řádky
9.4 KiB

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