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.
 
 
 
 

296 line
13 KiB

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