diff options
| author | Stefan Behnel <scoder@users.berlios.de> | 2011-05-19 08:42:53 +0200 |
|---|---|---|
| committer | Stefan Behnel <scoder@users.berlios.de> | 2011-05-19 08:42:53 +0200 |
| commit | 7d15b72ebb01efe74e060d530a097d9fa752b694 (patch) | |
| tree | 51e5bb780594778a344a439a76f1f44d5f7ae8f0 /src | |
| parent | de8033002431851ae78de45a98c0298c6c3c28e2 (diff) | |
| download | python-lxml-7d15b72ebb01efe74e060d530a097d9fa752b694.tar.gz | |
safer XHTML->HTML conversion in clean.py
Diffstat (limited to 'src')
| -rw-r--r-- | src/lxml/html/clean.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/lxml/html/clean.py b/src/lxml/html/clean.py index 21cd032d..50446cac 100644 --- a/src/lxml/html/clean.py +++ b/src/lxml/html/clean.py @@ -14,7 +14,7 @@ except ImportError: from lxml import etree from lxml.html import defs from lxml.html import fromstring, tostring, XHTML_NAMESPACE -from lxml.html import _nons, _transform_result +from lxml.html import xhtml_to_html, _transform_result try: set @@ -234,10 +234,7 @@ class Cleaner(object): # ElementTree instance, instead of an element doc = doc.getroot() # convert XHTML to HTML - for el in doc.iter(): - tag = el.tag - if isinstance(tag, basestring): - el.tag = _nons(tag) + xhtml_to_html(doc) # Normalize a case that IE treats <image> like <img>, and that # can confuse either this step or later steps. for el in doc.iter('image'): |
