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.
 
 
 
 

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