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.
 
 
 
 

307 lines
14 KiB

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