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.
 
 
 
 

245 lines
10 KiB

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