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.
 
 
 
 

402 lines
17 KiB

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