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.
 
 
 
 

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