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.
 
 
 
 

198 lines
8.7 KiB

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