A Python parser for MediaWiki wikicode https://mwparserfromhell.readthedocs.io/
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 

131 рядки
5.7 KiB

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