A Python parser for MediaWiki wikicode https://mwparserfromhell.readthedocs.io/
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 

330 rader
14 KiB

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