We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8421ee0 + 20e7c28 commit f3c99f7Copy full SHA for f3c99f7
diff.py
@@ -1,4 +1,4 @@
1
-#!/usr/bin/python2.2
+#!/usr/bin/python
2
"""HTML Diff: http://www.aaronsw.com/2002/diff
3
Rough code, badly documented. Send me comments and patches."""
4
@@ -15,7 +15,10 @@ def textDiff(a, b):
15
16
out = []
17
a, b = html2list(a), html2list(b)
18
- s = difflib.SequenceMatcher(None, a, b)
+ try: # autojunk can cause malformed HTML, but also speeds up processing.
19
+ s = difflib.SequenceMatcher(None, a, b, autojunk=False)
20
+ except TypeError:
21
+ s = difflib.SequenceMatcher(None, a, b)
22
for e in s.get_opcodes():
23
if e[0] == "replace":
24
# @@ need to do something more complicated here
0 commit comments