diff -r 7863c546b135 -r 2d7521881d3d entity.py --- a/entity.py Fri Jan 24 10:04:56 2014 +0100 +++ b/entity.py Mon Jan 27 16:19:49 2014 +0100 @@ -762,7 +762,7 @@ _engine=ENGINE): trdata = TransformData(data, format, encoding, appobject=self) data = _engine.convert(trdata, target_format).decode() - if format == 'text/html': + if target_format == 'text/html': data = soup2xhtml(data, self._cw.encoding) return data