A Python parser for MediaWiki wikicode https://mwparserfromhell.readthedocs.io/
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 

209 řádky
9.4 KiB

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