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.
 
 
 
 

218 lines
9.6 KiB

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