A Python parser for MediaWiki wikicode https://mwparserfromhell.readthedocs.io/
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 

319 行
14 KiB

  1. Changelog
  2. =========
  3. v0.6
  4. ----
  5. Unreleased
  6. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.5.2...develop>`__):
  7. - Fixed manual construction of Node objects, previously unsupported.
  8. (`#214 <https://github.com/earwig/mwparserfromhell/issues/214>`_)
  9. - Fixed :class:`.Wikicode` transformation methods (:meth:`.Wikicode.replace`,
  10. :meth:`.Wikicode.remove`, etc.) when passed an empty section as an argument.
  11. (`#212 <https://github.com/earwig/mwparserfromhell/issues/212>`_)
  12. v0.5.2
  13. ------
  14. `Released November 1, 2018 <https://github.com/earwig/mwparserfromhell/tree/v0.5.2>`_
  15. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.5.1...v0.5.2>`__):
  16. - Dropped support for end-of-life Python versions 2.6, 3.2, 3.3.
  17. (`#199 <https://github.com/earwig/mwparserfromhell/issues/199>`_,
  18. `#204 <https://github.com/earwig/mwparserfromhell/pull/204>`_)
  19. - Fixed signals getting stuck inside the C tokenizer until parsing finishes,
  20. in pathological cases.
  21. (`#206 <https://github.com/earwig/mwparserfromhell/issues/206>`_)
  22. - Fixed `<wbr>` not being considered a single-only tag.
  23. (`#200 <https://github.com/earwig/mwparserfromhell/pull/200>`_)
  24. - Fixed a C tokenizer crash on Python 3.7 when compiled with assertions.
  25. (`#208 <https://github.com/earwig/mwparserfromhell/issues/208>`_)
  26. - Cleaned up some minor documentation issues.
  27. (`#207 <https://github.com/earwig/mwparserfromhell/pull/207>`_)
  28. v0.5.1
  29. ------
  30. `Released March 3, 2018 <https://github.com/earwig/mwparserfromhell/tree/v0.5.1>`_
  31. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.5...v0.5.1>`__):
  32. - Improved behavior when adding parameters to templates (via
  33. :meth:`.Template.add`) with poorly formatted whitespace conventions.
  34. (`#185 <https://github.com/earwig/mwparserfromhell/issues/185>`_)
  35. - Fixed the parser getting stuck in deeply nested HTML tags with unclosed,
  36. quoted attributes.
  37. (`#190 <https://github.com/earwig/mwparserfromhell/issues/190>`_)
  38. v0.5
  39. ----
  40. `Released June 23, 2017 <https://github.com/earwig/mwparserfromhell/tree/v0.5>`_
  41. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.4.4...v0.5>`__):
  42. - Added :meth:`.Wikicode.contains` to determine whether a :class:`.Node` or
  43. :class:`.Wikicode` object is contained within another :class:`.Wikicode`
  44. object.
  45. - Added :meth:`.Wikicode.get_ancestors` and :meth:`.Wikicode.get_parent` to
  46. find all ancestors and the direct parent of a :class:`.Node`, respectively.
  47. - Fixed a long-standing performance issue with deeply nested, invalid syntax
  48. (`issue #42 <https://github.com/earwig/mwparserfromhell/issues/42>`_). The
  49. parser should be much faster on certain complex pages. The "max cycle"
  50. restriction has also been removed, so some situations where templates at the
  51. end of a page were being skipped are now resolved.
  52. - Made :meth:`Template.remove(keep_field=True) <.Template.remove>` behave more
  53. reasonably when the parameter is already empty.
  54. - Added the *keep_template_params* argument to :meth:`.Wikicode.strip_code`.
  55. If *True*, then template parameters will be preserved in the output.
  56. - :class:`.Wikicode` objects can now be pickled properly (fixed infinite
  57. recursion error on incompletely-constructed :class:`.StringMixIn`
  58. subclasses).
  59. - Fixed :meth:`.Wikicode.matches`\ 's behavior on iterables besides lists and
  60. tuples.
  61. - Fixed ``len()`` sometimes raising ``ValueError`` on empty node lists.
  62. - Fixed a rare parsing bug involving self-closing tags inside the attributes of
  63. unpaired tags.
  64. - Fixed release script after changes to PyPI.
  65. v0.4.4
  66. ------
  67. `Released December 30, 2016 <https://github.com/earwig/mwparserfromhell/tree/v0.4.4>`_
  68. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.4.3...v0.4.4>`__):
  69. - Added support for Python 3.6.
  70. - Fixed parsing bugs involving:
  71. - wikitables nested in templates;
  72. - wikitable error recovery when unable to recurse;
  73. - templates nested in template parameters before other parameters.
  74. - Fixed parsing file-like objects.
  75. - Made builds deterministic.
  76. - Documented caveats.
  77. v0.4.3
  78. ------
  79. `Released October 29, 2015 <https://github.com/earwig/mwparserfromhell/tree/v0.4.3>`_
  80. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.4.2...v0.4.3>`__):
  81. - Added Windows binaries for Python 3.5.
  82. - Fixed edge cases involving wikilinks inside of external links and vice versa.
  83. - Fixed a C tokenizer crash when a keyboard interrupt happens while parsing.
  84. v0.4.2
  85. ------
  86. `Released July 30, 2015 <https://github.com/earwig/mwparserfromhell/tree/v0.4.2>`__
  87. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.4.1...v0.4.2>`__):
  88. - Fixed setup script not including header files in releases.
  89. - Fixed Windows binary uploads.
  90. v0.4.1
  91. ------
  92. `Released July 30, 2015 <https://github.com/earwig/mwparserfromhell/tree/v0.4.1>`__
  93. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.4...v0.4.1>`__):
  94. - The process for building Windows binaries has been fixed, and these should be
  95. distributed along with new releases. Windows users can now take advantage of
  96. C speedups without having a compiler of their own.
  97. - Added support for Python 3.5.
  98. - ``<`` and ``>`` are now disallowed in wikilink titles and template names.
  99. This includes when denoting tags, but not comments.
  100. - Fixed the behavior of *preserve_spacing* in :meth:`.Template.add` and
  101. *keep_field* in :meth:`.Template.remove` on parameters with hidden keys.
  102. - Removed :meth:`._ListProxy.detach`. :class:`.SmartList`\ s now use weak
  103. references and their children are garbage-collected properly.
  104. - Fixed parser bugs involving:
  105. - templates with completely blank names;
  106. - templates with newlines and comments.
  107. - Heavy refactoring and fixes to the C tokenizer, including:
  108. - corrected a design flaw in text handling, allowing for substantial speed
  109. improvements when parsing long strings of plain text;
  110. - implemented new Python 3.3
  111. `PEP 393 <https://www.python.org/dev/peps/pep-0393/>`_ Unicode APIs.
  112. - Fixed various bugs in :class:`.SmartList`, including one that was causing
  113. memory issues on 64-bit builds of Python 2 on Windows.
  114. - Fixed some bugs in the release scripts.
  115. v0.4
  116. ----
  117. `Released May 23, 2015 <https://github.com/earwig/mwparserfromhell/tree/v0.4>`_
  118. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.3.3...v0.4>`__):
  119. - The parser now falls back on pure Python mode if C extensions cannot be
  120. built. This fixes an issue that prevented some Windows users from installing
  121. the parser.
  122. - Added support for parsing wikicode tables (patches by David Winegar).
  123. - Added a script to test for memory leaks in :file:`scripts/memtest.py`.
  124. - Added a script to do releases in :file:`scripts/release.sh`.
  125. - *skip_style_tags* can now be passed to :func:`mwparserfromhell.parse()
  126. <.parse_anything>` (previously, only :meth:`.Parser.parse` allowed it).
  127. - The *recursive* argument to :class:`Wikicode's <.Wikicode>` :meth:`.filter`
  128. methods now accepts a third option, ``RECURSE_OTHERS``, which recurses over
  129. all children except instances of *forcetype* (for example,
  130. ``code.filter_templates(code.RECURSE_OTHERS)`` returns all un-nested
  131. templates).
  132. - The parser now understands HTML tag attributes quoted with single quotes.
  133. When setting a tag attribute's value, quotes will be added if necessary. As
  134. part of this, :class:`.Attribute`\ 's :attr:`~.Attribute.quoted` attribute
  135. has been changed to :attr:`~.Attribute.quotes`, and is now either a string or
  136. ``None``.
  137. - Calling :meth:`.Template.remove` with a :class:`.Parameter` object that is
  138. not part of the template now raises :exc:`ValueError` instead of doing
  139. nothing.
  140. - :class:`.Parameter`\ s with non-integer keys can no longer be created with
  141. *showkey=False*, nor have the value of this attribute be set to *False*
  142. later.
  143. - :meth:`._ListProxy.destroy` has been changed to :meth:`._ListProxy.detach`,
  144. and now works in a more useful way.
  145. - If something goes wrong while parsing, :exc:`.ParserError` will now be
  146. raised. Previously, the parser would produce an unclear :exc:`.BadRoute`
  147. exception or allow an incorrect node tree to be build.
  148. - Fixed parser bugs involving:
  149. - nested tags;
  150. - comments in template names;
  151. - tags inside of ``<nowiki>`` tags.
  152. - Added tests to ensure that parsed trees convert back to wikicode without
  153. unintentional modifications.
  154. - Added support for a :envvar:`NOWEB` environment variable, which disables a
  155. unit test that makes a web call.
  156. - Test coverage has been improved, and some minor related bugs have been fixed.
  157. - Updated and fixed some documentation.
  158. v0.3.3
  159. ------
  160. `Released April 22, 2014 <https://github.com/earwig/mwparserfromhell/tree/v0.3.3>`_
  161. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.3.2...v0.3.3>`__):
  162. - Added support for Python 2.6 and 3.4.
  163. - :meth:`.Template.has` is now passed *ignore_empty=False* by default
  164. instead of *True*. This fixes a bug when adding parameters to templates with
  165. empty fields, **and is a breaking change if you rely on the default
  166. behavior.**
  167. - The *matches* argument of :class:`Wikicode's <.Wikicode>` :meth:`.filter`
  168. methods now accepts a function (taking one argument, a :class:`.Node`, and
  169. returning a bool) in addition to a regex.
  170. - Re-added *flat* argument to :meth:`.Wikicode.get_sections`, fixed the order
  171. in which it returns sections, and made it faster.
  172. - :meth:`.Wikicode.matches` now accepts a tuple or list of
  173. strings/:class:`.Wikicode` objects instead of just a single string or
  174. :class:`.Wikicode`.
  175. - Given the frequency of issues with the (admittedly insufficient) tag parser,
  176. there's a temporary *skip_style_tags* argument to :meth:`~.Parser.parse` that
  177. ignores ``''`` and ``'''`` until these issues are corrected.
  178. - Fixed a parser bug involving nested wikilinks and external links.
  179. - C code cleanup and speed improvements.
  180. v0.3.2
  181. ------
  182. `Released September 1, 2013 <https://github.com/earwig/mwparserfromhell/tree/v0.3.2>`_
  183. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.3.1...v0.3.2>`__):
  184. - Added support for Python 3.2 (along with current support for 3.3 and 2.7).
  185. - Renamed :meth:`.Template.remove`\ 's first argument from *name* to *param*,
  186. which now accepts :class:`.Parameter` objects in addition to parameter name
  187. strings.
  188. v0.3.1
  189. ------
  190. `Released August 29, 2013 <https://github.com/earwig/mwparserfromhell/tree/v0.3.1>`_
  191. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.3...v0.3.1>`__):
  192. - Fixed a parser bug involving URLs nested inside other markup.
  193. - Fixed some typos.
  194. v0.3
  195. ----
  196. `Released August 24, 2013 <https://github.com/earwig/mwparserfromhell/tree/v0.3>`_
  197. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.2...v0.3>`__):
  198. - Added complete support for HTML :class:`Tags <.Tag>`, including forms like
  199. ``<ref>foo</ref>``, ``<ref name="bar"/>``, and wiki-markup tags like bold
  200. (``'''``), italics (``''``), and lists (``*``, ``#``, ``;`` and ``:``).
  201. - Added support for :class:`.ExternalLink`\ s (``http://example.com/`` and
  202. ``[http://example.com/ Example]``).
  203. - :class:`Wikicode's <.Wikicode>` :meth:`.filter` methods are now passed
  204. *recursive=True* by default instead of *False*. **This is a breaking change
  205. if you rely on any filter() methods being non-recursive by default.**
  206. - Added a :meth:`.matches` method to :class:`.Wikicode` for page/template name
  207. comparisons.
  208. - The *obj* param of :meth:`.Wikicode.insert_before`, :meth:`.insert_after`,
  209. :meth:`~.Wikicode.replace`, and :meth:`~.Wikicode.remove` now accepts
  210. :class:`.Wikicode` objects and strings representing parts of wikitext,
  211. instead of just nodes. These methods also make all possible substitutions
  212. instead of just one.
  213. - Renamed :meth:`.Template.has_param` to :meth:`~.Template.has` for consistency
  214. with :class:`.Template`\ 's other methods; :meth:`.has_param` is now an
  215. alias.
  216. - The C tokenizer extension now works on Python 3 in addition to Python 2.7.
  217. - Various bugfixes, internal changes, and cleanup.
  218. v0.2
  219. ----
  220. `Released June 20, 2013 <https://github.com/earwig/mwparserfromhell/tree/v0.2>`_
  221. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.1.1...v0.2>`__):
  222. - The parser now fully supports Python 3 in addition to Python 2.7.
  223. - Added a C tokenizer extension that is significantly faster than its Python
  224. equivalent. It is enabled by default (if available) and can be toggled by
  225. setting :attr:`mwparserfromhell.parser.use_c` to a boolean value.
  226. - Added a complete set of unit tests covering parsing and wikicode
  227. manipulation.
  228. - Renamed :meth:`.filter_links` to :meth:`.filter_wikilinks` (applies to
  229. :meth:`.ifilter` as well).
  230. - Added filter methods for :class:`Arguments <.Argument>`,
  231. :class:`Comments <.Comment>`, :class:`Headings <.Heading>`, and
  232. :class:`HTMLEntities <.HTMLEntity>`.
  233. - Added *before* param to :meth:`.Template.add`; renamed *force_nonconformity*
  234. to *preserve_spacing*.
  235. - Added *include_lead* param to :meth:`.Wikicode.get_sections`.
  236. - Removed *flat* param from :meth:`.get_sections`.
  237. - Removed *force_no_field* param from :meth:`.Template.remove`.
  238. - Added support for Travis CI.
  239. - Added note about Windows build issue in the README.
  240. - The tokenizer will limit itself to a realistic recursion depth to prevent
  241. errors and unreasonably long parse times.
  242. - Fixed how some nodes' attribute setters handle input.
  243. - Fixed multiple bugs in the tokenizer's handling of invalid markup.
  244. - Fixed bugs in the implementation of :class:`.SmartList` and
  245. :class:`.StringMixIn`.
  246. - Fixed some broken example code in the README; other copyedits.
  247. - Other bugfixes and code cleanup.
  248. v0.1.1
  249. ------
  250. `Released September 21, 2012 <https://github.com/earwig/mwparserfromhell/tree/v0.1.1>`_
  251. (`changes <https://github.com/earwig/mwparserfromhell/compare/v0.1...v0.1.1>`__):
  252. - Added support for :class:`Comments <.Comment>` (``<!-- foo -->``) and
  253. :class:`Wikilinks <.Wikilink>` (``[[foo]]``).
  254. - Added corresponding :meth:`.ifilter_links` and :meth:`.filter_links` methods
  255. to :class:`.Wikicode`.
  256. - Fixed a bug when parsing incomplete templates.
  257. - Fixed :meth:`.strip_code` to affect the contents of headings.
  258. - Various copyedits in documentation and comments.
  259. v0.1
  260. ----
  261. `Released August 23, 2012 <https://github.com/earwig/mwparserfromhell/tree/v0.1>`_:
  262. - Initial release.