A Python parser for MediaWiki wikicode https://mwparserfromhell.readthedocs.io/
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 

227 rindas
9.9 KiB

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