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.
 
 
 
 

228 lines
9.9 KiB

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