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.
 
 
 
 

241 lines
10 KiB

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