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.
 
 
 
 

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