A Python parser for MediaWiki wikicode https://mwparserfromhell.readthedocs.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

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