[lxml-dev] Strange problem with lxml.html.diff

James Zhu james at yaean.com
Thu Mar 13 11:26:05 CET 2008


Hi guys,

Here's what I did:

james at orchid ~ $ python
Python 2.4.4 (#1, Mar 10 2008, 14:55:59)
[GCC 4.1.2 (Gentoo 4.1.2 p1.0.2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from lxml import etree
>>> etree.LXML_VERSION
(2, 0, 2, 0)
>>> from lxml.html.diff import htmldiff
>>> doc1 = """some <p> test"""
>>> doc2 = """some <p> text"""
>>> print htmldiff(doc1, doc2)
some <p><ins>text</ins></p> <p><del>test</del></p>
>>> doc3 = """some <br> test"""
>>> doc4 = """some <br> text"""
>>> print htmldiff(doc3, doc4)
some <br>
>>>

It seems that the contents after <br> mysteriously disappeared. Any ideas?

Regards

James


More information about the lxml-dev mailing list