A Python parser for MediaWiki wikicode https://mwparserfromhell.readthedocs.io/
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

417 Zeilen
18 KiB

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