A Python parser for MediaWiki wikicode https://mwparserfromhell.readthedocs.io/
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 

263 satır
11 KiB

  1. Changelog
  2. =========
  3. v0.5
  4. ----
  5. Unreleased
  6. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.4.4...develop>`__):
  7. - Made :meth:`Template.remove(keep_field=True) <.Template.remove>` behave more
  8. reasonably when the parameter is already empty.
  9. - Added the *keep_template_params* argument to :meth:`.Wikicode.strip_code`.
  10. If *True*, then template parameters will be preserved in the output.
  11. - :class:`.Wikicode` objects can now be pickled properly (fixed infinite
  12. recursion error on incompletely-constructed :class:`.StringMixIn`
  13. subclasses).
  14. - Fixed :meth:`.Wikicode.matches`\ 's behavior on iterables besides lists and
  15. tuples.
  16. - Fixed ``len()`` sometimes raising ``ValueError`` on empty node lists.
  17. - Fixed release script after changes to PyPI.
  18. v0.4.4
  19. ------
  20. `Released December 30, 2016 <https://github.com/earwig/mwparserfromhell/tree/v0.4.4>`_
  21. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.4.3...v0.4.4>`__):
  22. - Added support for Python 3.6.
  23. - Fixed parsing bugs involving:
  24. - wikitables nested in templates;
  25. - wikitable error recovery when unable to recurse;
  26. - templates nested in template parameters before other parameters.
  27. - Fixed parsing file-like objects.
  28. - Made builds deterministic.
  29. - Documented caveats.
  30. v0.4.3
  31. ------
  32. `Released October 29, 2015 <https://github.com/earwig/mwparserfromhell/tree/v0.4.3>`_
  33. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.4.2...v0.4.3>`__):
  34. - Added Windows binaries for Python 3.5.
  35. - Fixed edge cases involving wikilinks inside of external links and vice versa.
  36. - Fixed a C tokenizer crash when a keyboard interrupt happens while parsing.
  37. v0.4.2
  38. ------
  39. `Released July 30, 2015 <https://github.com/earwig/mwparserfromhell/tree/v0.4.2>`_
  40. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.4.1...v0.4.2>`__):
  41. - Fixed setup script not including header files in releases.
  42. - Fixed Windows binary uploads.
  43. v0.4.1
  44. ------
  45. `Released July 30, 2015 <https://github.com/earwig/mwparserfromhell/tree/v0.4.1>`_
  46. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.4...v0.4.1>`__):
  47. - The process for building Windows binaries has been fixed, and these should be
  48. distributed along with new releases. Windows users can now take advantage of
  49. C speedups without having a compiler of their own.
  50. - Added support for Python 3.5.
  51. - ``<`` and ``>`` are now disallowed in wikilink titles and template names.
  52. This includes when denoting tags, but not comments.
  53. - Fixed the behavior of *preserve_spacing* in :meth:`.Template.add` and
  54. *keep_field* in :meth:`.Template.remove` on parameters with hidden keys.
  55. - Removed :meth:`._ListProxy.detach`. :class:`.SmartList`\ s now use weak
  56. references and their children are garbage-collected properly.
  57. - Fixed parser bugs involving:
  58. - templates with completely blank names;
  59. - templates with newlines and comments.
  60. - Heavy refactoring and fixes to the C tokenizer, including:
  61. - corrected a design flaw in text handling, allowing for substantial speed
  62. improvements when parsing long strings of plain text;
  63. - implemented new Python 3.3
  64. `PEP 393 <https://www.python.org/dev/peps/pep-0393/>`_ Unicode APIs.
  65. - Fixed various bugs in :class:`.SmartList`, including one that was causing
  66. memory issues on 64-bit builds of Python 2 on Windows.
  67. - Fixed some bugs in the release scripts.
  68. v0.4
  69. ----
  70. `Released May 23, 2015 <https://github.com/earwig/mwparserfromhell/tree/v0.4>`_
  71. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.3.3...v0.4>`__):
  72. - The parser now falls back on pure Python mode if C extensions cannot be
  73. built. This fixes an issue that prevented some Windows users from installing
  74. the parser.
  75. - Added support for parsing wikicode tables (patches by David Winegar).
  76. - Added a script to test for memory leaks in :file:`scripts/memtest.py`.
  77. - Added a script to do releases in :file:`scripts/release.sh`.
  78. - *skip_style_tags* can now be passed to :func:`mwparserfromhell.parse()
  79. <.parse_anything>` (previously, only :meth:`.Parser.parse` allowed it).
  80. - The *recursive* argument to :class:`Wikicode's <.Wikicode>` :meth:`.filter`
  81. methods now accepts a third option, ``RECURSE_OTHERS``, which recurses over
  82. all children except instances of *forcetype* (for example,
  83. ``code.filter_templates(code.RECURSE_OTHERS)`` returns all un-nested
  84. templates).
  85. - The parser now understands HTML tag attributes quoted with single quotes.
  86. When setting a tag attribute's value, quotes will be added if necessary. As
  87. part of this, :class:`.Attribute`\ 's :attr:`~.Attribute.quoted` attribute
  88. has been changed to :attr:`~.Attribute.quotes`, and is now either a string or
  89. ``None``.
  90. - Calling :meth:`.Template.remove` with a :class:`.Parameter` object that is
  91. not part of the template now raises :exc:`ValueError` instead of doing
  92. nothing.
  93. - :class:`.Parameter`\ s with non-integer keys can no longer be created with
  94. *showkey=False*, nor have the value of this attribute be set to *False*
  95. later.
  96. - :meth:`._ListProxy.destroy` has been changed to :meth:`._ListProxy.detach`,
  97. and now works in a more useful way.
  98. - If something goes wrong while parsing, :exc:`.ParserError` will now be
  99. raised. Previously, the parser would produce an unclear :exc:`.BadRoute`
  100. exception or allow an incorrect node tree to be build.
  101. - Fixed parser bugs involving:
  102. - nested tags;
  103. - comments in template names;
  104. - tags inside of ``<nowiki>`` tags.
  105. - Added tests to ensure that parsed trees convert back to wikicode without
  106. unintentional modifications.
  107. - Added support for a :envvar:`NOWEB` environment variable, which disables a
  108. unit test that makes a web call.
  109. - Test coverage has been improved, and some minor related bugs have been fixed.
  110. - Updated and fixed some documentation.
  111. v0.3.3
  112. ------
  113. `Released April 22, 2014 <https://github.com/earwig/mwparserfromhell/tree/v0.3.3>`_
  114. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.3.2...v0.3.3>`__):
  115. - Added support for Python 2.6 and 3.4.
  116. - :meth:`.Template.has` is now passed *ignore_empty=False* by default
  117. instead of *True*. This fixes a bug when adding parameters to templates with
  118. empty fields, **and is a breaking change if you rely on the default
  119. behavior.**
  120. - The *matches* argument of :class:`Wikicode's <.Wikicode>` :meth:`.filter`
  121. methods now accepts a function (taking one argument, a :class:`.Node`, and
  122. returning a bool) in addition to a regex.
  123. - Re-added *flat* argument to :meth:`.Wikicode.get_sections`, fixed the order
  124. in which it returns sections, and made it faster.
  125. - :meth:`.Wikicode.matches` now accepts a tuple or list of
  126. strings/:class:`.Wikicode` objects instead of just a single string or
  127. :class:`.Wikicode`.
  128. - Given the frequency of issues with the (admittedly insufficient) tag parser,
  129. there's a temporary *skip_style_tags* argument to :meth:`~.Parser.parse` that
  130. ignores ``''`` and ``'''`` until these issues are corrected.
  131. - Fixed a parser bug involving nested wikilinks and external links.
  132. - C code cleanup and speed improvements.
  133. v0.3.2
  134. ------
  135. `Released September 1, 2013 <https://github.com/earwig/mwparserfromhell/tree/v0.3.2>`_
  136. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.3.1...v0.3.2>`__):
  137. - Added support for Python 3.2 (along with current support for 3.3 and 2.7).
  138. - Renamed :meth:`.Template.remove`\ 's first argument from *name* to *param*,
  139. which now accepts :class:`.Parameter` objects in addition to parameter name
  140. strings.
  141. v0.3.1
  142. ------
  143. `Released August 29, 2013 <https://github.com/earwig/mwparserfromhell/tree/v0.3.1>`_
  144. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.3...v0.3.1>`__):
  145. - Fixed a parser bug involving URLs nested inside other markup.
  146. - Fixed some typos.
  147. v0.3
  148. ----
  149. `Released August 24, 2013 <https://github.com/earwig/mwparserfromhell/tree/v0.3>`_
  150. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.2...v0.3>`__):
  151. - Added complete support for HTML :class:`Tags <.Tag>`, including forms like
  152. ``<ref>foo</ref>``, ``<ref name="bar"/>``, and wiki-markup tags like bold
  153. (``'''``), italics (``''``), and lists (``*``, ``#``, ``;`` and ``:``).
  154. - Added support for :class:`.ExternalLink`\ s (``http://example.com/`` and
  155. ``[http://example.com/ Example]``).
  156. - :class:`Wikicode's <.Wikicode>` :meth:`.filter` methods are now passed
  157. *recursive=True* by default instead of *False*. **This is a breaking change
  158. if you rely on any filter() methods being non-recursive by default.**
  159. - Added a :meth:`.matches` method to :class:`.Wikicode` for page/template name
  160. comparisons.
  161. - The *obj* param of :meth:`.Wikicode.insert_before`, :meth:`.insert_after`,
  162. :meth:`~.Wikicode.replace`, and :meth:`~.Wikicode.remove` now accepts
  163. :class:`.Wikicode` objects and strings representing parts of wikitext,
  164. instead of just nodes. These methods also make all possible substitutions
  165. instead of just one.
  166. - Renamed :meth:`.Template.has_param` to :meth:`~.Template.has` for consistency
  167. with :class:`.Template`\ 's other methods; :meth:`.has_param` is now an
  168. alias.
  169. - The C tokenizer extension now works on Python 3 in addition to Python 2.7.
  170. - Various bugfixes, internal changes, and cleanup.
  171. v0.2
  172. ----
  173. `Released June 20, 2013 <https://github.com/earwig/mwparserfromhell/tree/v0.2>`_
  174. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.1.1...v0.2>`__):
  175. - The parser now fully supports Python 3 in addition to Python 2.7.
  176. - Added a C tokenizer extension that is significantly faster than its Python
  177. equivalent. It is enabled by default (if available) and can be toggled by
  178. setting :attr:`mwparserfromhell.parser.use_c` to a boolean value.
  179. - Added a complete set of unit tests covering parsing and wikicode
  180. manipulation.
  181. - Renamed :meth:`.filter_links` to :meth:`.filter_wikilinks` (applies to
  182. :meth:`.ifilter` as well).
  183. - Added filter methods for :class:`Arguments <.Argument>`,
  184. :class:`Comments <.Comment>`, :class:`Headings <.Heading>`, and
  185. :class:`HTMLEntities <.HTMLEntity>`.
  186. - Added *before* param to :meth:`.Template.add`; renamed *force_nonconformity*
  187. to *preserve_spacing*.
  188. - Added *include_lead* param to :meth:`.Wikicode.get_sections`.
  189. - Removed *flat* param from :meth:`.get_sections`.
  190. - Removed *force_no_field* param from :meth:`.Template.remove`.
  191. - Added support for Travis CI.
  192. - Added note about Windows build issue in the README.
  193. - The tokenizer will limit itself to a realistic recursion depth to prevent
  194. errors and unreasonably long parse times.
  195. - Fixed how some nodes' attribute setters handle input.
  196. - Fixed multiple bugs in the tokenizer's handling of invalid markup.
  197. - Fixed bugs in the implementation of :class:`.SmartList` and
  198. :class:`.StringMixIn`.
  199. - Fixed some broken example code in the README; other copyedits.
  200. - Other bugfixes and code cleanup.
  201. v0.1.1
  202. ------
  203. `Released September 21, 2012 <https://github.com/earwig/mwparserfromhell/tree/v0.1.1>`_
  204. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.1...v0.1.1>`__):
  205. - Added support for :class:`Comments <.Comment>` (``<!-- foo -->``) and
  206. :class:`Wikilinks <.Wikilink>` (``[[foo]]``).
  207. - Added corresponding :meth:`.ifilter_links` and :meth:`.filter_links` methods
  208. to :class:`.Wikicode`.
  209. - Fixed a bug when parsing incomplete templates.
  210. - Fixed :meth:`.strip_code` to affect the contents of headings.
  211. - Various copyedits in documentation and comments.
  212. v0.1
  213. ----
  214. `Released August 23, 2012 <https://github.com/earwig/mwparserfromhell/tree/v0.1>`_:
  215. - Initial release.