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.
 
 
 
 

407 lines
17 KiB

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