A Python parser for MediaWiki wikicode https://mwparserfromhell.readthedocs.io/
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

388 строки
16 KiB

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