summaryrefslogtreecommitdiffstats
path: root/Lib/difflib.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/difflib.py')
-rw-r--r--Lib/difflib.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/difflib.py b/Lib/difflib.py
index 887c3c2..4571817 100644
--- a/Lib/difflib.py
+++ b/Lib/difflib.py
@@ -2036,6 +2036,10 @@ class HtmlDiff(object):
s.append( fmt % (next_id[i],next_href[i],fromlist[i],
next_href[i],tolist[i]))
if fromdesc or todesc:
+ fromdesc = fromdesc.replace("&", "&").replace(">", ">") \
+ .replace("<", "&lt;")
+ todesc = todesc.replace("&", "&amp;").replace(">", "&gt;") \
+ .replace("<", "&lt;")
header_row = '<thead><tr>%s%s%s%s</tr></thead>' % (
'<th class="diff_next"><br /></th>',
'<th colspan="2" class="diff_header">%s</th>' % fromdesc,