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.
 
 
 
 

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