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.

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