A Python parser for MediaWiki wikicode https://mwparserfromhell.readthedocs.io/
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

170 lignes
7.7 KiB

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