Bläddra i källkod

Properly read from file-like objects when passed to parse_anything() (#137)

tags/v0.4.4
Ben Kurtovic 8 år sedan
förälder
incheckning
af666bba16
3 ändrade filer med 5 tillägg och 0 borttagningar
  1. +1
    -0
      CHANGELOG
  2. +2
    -0
      docs/changelog.rst
  3. +2
    -0
      mwparserfromhell/utils.py

+ 1
- 0
CHANGELOG Visa fil

@@ -3,6 +3,7 @@ v0.5 (unreleased):
- Fixed parsing bugs involving:
- wikitables nested in templates;
- wikitable error recovery when unable to recurse.
- Fixed parsing file-like objects.

v0.4.3 (released October 29, 2015):



+ 2
- 0
docs/changelog.rst Visa fil

@@ -12,6 +12,8 @@ Unreleased
- wikitables nested in templates;
- wikitable error recovery when unable to recurse.

- Fixed parsing file-like objects.

v0.4.3
------



+ 2
- 0
mwparserfromhell/utils.py Visa fil

@@ -62,6 +62,8 @@ def parse_anything(value, context=0, skip_style_tags=False):
return Parser().parse(str(value), context, skip_style_tags)
elif value is None:
return Wikicode(SmartList())
elif hasattr(value, "read"):
return parse_anything(value.read(), context, skip_style_tags)
try:
nodelist = SmartList()
for item in value:


Laddar…
Avbryt
Spara