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.
 
 
 
 

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