A Python parser for MediaWiki wikicode https://mwparserfromhell.readthedocs.io/
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

changelog.rst 7.8 KiB

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