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.
 
 
 
 

329 lines
14 KiB

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