A Python parser for MediaWiki wikicode https://mwparserfromhell.readthedocs.io/
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 

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