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.
 
 
 
 

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