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.
 
 
 
 

317 lines
14 KiB

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