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.

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