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.

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