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.
 
 
 
 

105 lines
5.0 KiB

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