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.
 
 
 
 

254 line
11 KiB

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