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.
 
 
 
 

168 line
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 support for parsing wikicode tables.
  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. - Test coverage has been improved, and some minor related bugs have been fixed.
  38. - Updated and fixed some documentation.
  39. v0.3.3
  40. ------
  41. `Released April 22, 2014 <https://github.com/earwig/mwparserfromhell/tree/v0.3.3>`_
  42. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.3.2...v0.3.3>`__):
  43. - Added support for Python 2.6 and 3.4.
  44. - :meth:`.Template.has` is now passed *ignore_empty=False* by default
  45. instead of *True*. This fixes a bug when adding parameters to templates with
  46. empty fields, **and is a breaking change if you rely on the default
  47. behavior.**
  48. - The *matches* argument of :class:`Wikicode's <.Wikicode>` :meth:`.filter`
  49. methods now accepts a function (taking one argument, a :class:`.Node`, and
  50. returning a bool) in addition to a regex.
  51. - Re-added *flat* argument to :meth:`.Wikicode.get_sections`, fixed the order
  52. in which it returns sections, and made it faster.
  53. - :meth:`.Wikicode.matches` now accepts a tuple or list of
  54. strings/:class:`.Wikicode` objects instead of just a single string or
  55. :class:`.Wikicode`.
  56. - Given the frequency of issues with the (admittedly insufficient) tag parser,
  57. there's a temporary *skip_style_tags* argument to :meth:`~.Parser.parse` that
  58. ignores ``''`` and ``'''`` until these issues 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 :meth:`.Template.remove`\ 's first argument from *name* to *param*,
  67. which now accepts :class:`.Parameter` objects in addition to parameter name
  68. 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 :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 :class:`.ExternalLink`\ s (``http://example.com/`` and
  83. ``[http://example.com/ Example]``).
  84. - :class:`Wikicode's <.Wikicode>` :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 :meth:`.matches` method to :class:`.Wikicode` for page/template name
  88. comparisons.
  89. - The *obj* param of :meth:`.Wikicode.insert_before`, :meth:`.insert_after`,
  90. :meth:`~.Wikicode.replace`, and :meth:`~.Wikicode.remove` now accepts
  91. :class:`.Wikicode` objects and strings representing parts of wikitext,
  92. instead of just nodes. These methods also make all possible substitutions
  93. instead of just one.
  94. - Renamed :meth:`.Template.has_param` to :meth:`~.Template.has` for consistency
  95. with :class:`.Template`\ 's other methods; :meth:`.has_param` is now an
  96. 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 :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 :meth:`.filter_links` to :meth:`.filter_wikilinks` (applies to
  110. :meth:`.ifilter` as well).
  111. - Added filter methods for :class:`Arguments <.Argument>`,
  112. :class:`Comments <.Comment>`, :class:`Headings <.Heading>`, and
  113. :class:`HTMLEntities <.HTMLEntity>`.
  114. - Added *before* param to :meth:`.Template.add`; renamed *force_nonconformity*
  115. to *preserve_spacing*.
  116. - Added *include_lead* param to :meth:`.Wikicode.get_sections`.
  117. - Removed *flat* param from :meth:`.get_sections`.
  118. - Removed *force_no_field* param from :meth:`.Template.remove`.
  119. - Added support for Travis CI.
  120. - Added note about Windows build issue in the README.
  121. - The tokenizer will limit itself to a realistic recursion depth to prevent
  122. errors and unreasonably long parse times.
  123. - Fixed how some nodes' attribute setters handle input.
  124. - Fixed multiple bugs in the tokenizer's handling of invalid markup.
  125. - Fixed bugs in the implementation of :class:`.SmartList` and
  126. :class:`.StringMixIn`.
  127. - Fixed some broken example code in the README; other copyedits.
  128. - Other bugfixes and code cleanup.
  129. v0.1.1
  130. ------
  131. `Released September 21, 2012 <https://github.com/earwig/mwparserfromhell/tree/v0.1.1>`_
  132. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.1...v0.1.1>`__):
  133. - Added support for :class:`Comments <.Comment>` (``<!-- foo -->``) and
  134. :class:`Wikilinks <.Wikilink>` (``[[foo]]``).
  135. - Added corresponding :meth:`.ifilter_links` and :meth:`.filter_links` methods
  136. to :class:`.Wikicode`.
  137. - Fixed a bug when parsing incomplete templates.
  138. - Fixed :meth:`.strip_code` to affect the contents of headings.
  139. - Various copyedits in documentation and comments.
  140. v0.1
  141. ----
  142. `Released August 23, 2012 <https://github.com/earwig/mwparserfromhell/tree/v0.1>`_:
  143. - Initial release.