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.
 
 
 
 

338 lines
14 KiB

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