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.
 
 
 
 

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