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.
 
 
 
 

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