Released December 30, 2016
- Added support for Python 3.6.
- Fixed parsing bugs involving:
- wikitables nested in templates;
- wikitable error recovery when unable to recurse;
- templates nested in template parameters before other parameters.
- Fixed parsing file-like objects.
- Made builds deterministic.
- Documented caveats.
Released October 29, 2015
- Added Windows binaries for Python 3.5.
- Fixed edge cases involving wikilinks inside of external links and vice versa.
- Fixed a C tokenizer crash when a keyboard interrupt happens while parsing.
Released July 30, 2015
- The process for building Windows binaries has been fixed, and these should be
distributed along with new releases. Windows users can now take advantage of
C speedups without having a compiler of their own.
- Added support for Python 3.5.
> are now disallowed in wikilink titles and template names.
This includes when denoting tags, but not comments.
- Fixed the behavior of preserve_spacing in
Template.remove() on parameters with hidden keys.
SmartLists now use weak
references and their children are garbage-collected properly.
- Fixed parser bugs involving:
- templates with completely blank names;
- templates with newlines and comments.
- Heavy refactoring and fixes to the C tokenizer, including:
- corrected a design flaw in text handling, allowing for substantial speed
improvements when parsing long strings of plain text;
- implemented new Python 3.3
PEP 393 Unicode APIs.
- Fixed various bugs in
SmartList, including one that was causing
memory issues on 64-bit builds of Python 2 on Windows.
- Fixed some bugs in the release scripts.
Released May 23, 2015
- The parser now falls back on pure Python mode if C extensions cannot be
built. This fixes an issue that prevented some Windows users from installing
- Added support for parsing wikicode tables (patches by David Winegar).
- Added a script to test for memory leaks in
- Added a script to do releases in
- skip_style_tags can now be passed to
mwparserfromhell.parse() (previously, only
Parser.parse() allowed it).
- The recursive argument to
methods now accepts a third option,
RECURSE_OTHERS, which recurses over
all children except instances of forcetype (for example,
code.filter_templates(code.RECURSE_OTHERS) returns all un-nested
- The parser now understands HTML tag attributes quoted with single quotes.
When setting a tag attribute’s value, quotes will be added if necessary. As
part of this,
has been changed to
quotes, and is now either a string or
Template.remove() with a
Parameter object that is
not part of the template now raises
ValueError instead of doing
Parameters with non-integer keys can no longer be created with
showkey=False, nor have the value of this attribute be set to False
_ListProxy.destroy() has been changed to
and now works in a more useful way.
- If something goes wrong while parsing,
ParserError will now be
raised. Previously, the parser would produce an unclear
exception or allow an incorrect node tree to be build.
- Fixed parser bugs involving:
- nested tags;
- comments in template names;
- tags inside of
- Added tests to ensure that parsed trees convert back to wikicode without
- Added support for a
NOWEB environment variable, which disables a
unit test that makes a web call.
- Test coverage has been improved, and some minor related bugs have been fixed.
- Updated and fixed some documentation.
Released April 22, 2014
- Added support for Python 2.6 and 3.4.
Template.has() is now passed ignore_empty=False by default
instead of True. This fixes a bug when adding parameters to templates with
empty fields, and is a breaking change if you rely on the default
- The matches argument of
methods now accepts a function (taking one argument, a
returning a bool) in addition to a regex.
- Re-added flat argument to
Wikicode.get_sections(), fixed the order
in which it returns sections, and made it faster.
Wikicode.matches() now accepts a tuple or list of
Wikicode objects instead of just a single string or
- Given the frequency of issues with the (admittedly insufficient) tag parser,
there’s a temporary skip_style_tags argument to
''' until these issues are corrected.
- Fixed a parser bug involving nested wikilinks and external links.
- C code cleanup and speed improvements.
Released August 24, 2013
- Added complete support for HTML
Tags, including forms like
<ref name="bar"/>, and wiki-markup tags like bold
'''), italics (
''), and lists (
- Added support for
filter() methods are now passed
recursive=True by default instead of False. This is a breaking change
if you rely on any filter() methods being non-recursive by default.
- Added a
matches() method to
Wikicode for page/template name
- The obj param of
remove() now accepts
Wikicode objects and strings representing parts of wikitext,
instead of just nodes. These methods also make all possible substitutions
instead of just one.
has() for consistency
Template‘s other methods;
has_param() is now an
- The C tokenizer extension now works on Python 3 in addition to Python 2.7.
- Various bugfixes, internal changes, and cleanup.
Released June 20, 2013
- The parser now fully supports Python 3 in addition to Python 2.7.
- Added a C tokenizer extension that is significantly faster than its Python
equivalent. It is enabled by default (if available) and can be toggled by
mwparserfromhell.parser.use_c to a boolean value.
- Added a complete set of unit tests covering parsing and wikicode
filter_wikilinks() (applies to
ifilter() as well).
- Added filter methods for
- Added before param to
Template.add(); renamed force_nonconformity
- Added include_lead param to
- Removed flat param from
- Removed force_no_field param from
- Added support for Travis CI.
- Added note about Windows build issue in the README.
- The tokenizer will limit itself to a realistic recursion depth to prevent
errors and unreasonably long parse times.
- Fixed how some nodes’ attribute setters handle input.
- Fixed multiple bugs in the tokenizer’s handling of invalid markup.
- Fixed bugs in the implementation of
- Fixed some broken example code in the README; other copyedits.
- Other bugfixes and code cleanup.