htmldiff icon indicating copy to clipboard operation
htmldiff copied to clipboard

Malformed HTML output

Open ddohler opened this issue 13 years ago • 0 comments

Due to the way difflib.SequenceMatcher selects the longest match, ins tags may sometimes be placed in ways that result in malformed HTML. Example below.

>>> a = "<p>a</p><p>This is a test.</p>"
>>> b = "<p>a</p><p>b</p><p>This is a test.</p>"
>>> diff.textDiff(a,b)
'<p>a<ins class="diff"></p><p>b</ins></p><p>This is a test.</p>'

ddohler avatar Jan 06 '13 02:01 ddohler