A Python parser for MediaWiki wikicode https://mwparserfromhell.readthedocs.io/
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

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