@@ -133,18 +133,20 @@ def get_stripped_string(self):
133
133
class HTMLMatcher (SequenceMatcher ):
134
134
"""SequenceMatcher for HTML data."""
135
135
136
- start_insert_text = '<span class="insert">'
137
- end_span_text = '</span>'
138
- start_delete_text = '<span class="delete">'
139
- stylesheet = (
140
- '.insert {\n \t background-color: #AFA\n }\n '
141
- '.delete {\n '
142
- '\t background-color: #F88;\n '
143
- '\t text-decoration: line-through;\n '
144
- '}\n '
145
- '.tagInsert {\n \t background-color: #070;\n \t color: #FFF\n }\n '
146
- '.tagDelete {\n \t background-color: #700;\n \t color: #FFF\n }\n '
147
- )
136
+ start_insert_text = '<ins>'
137
+ end_insert_text = '</ins>'
138
+ start_delete_text = '<del>'
139
+ end_delete_text = '</del>'
140
+ stylesheet = """
141
+ del {
142
+ text-decoration: line-through;
143
+ background-color: #fbb;
144
+ color: #555;
145
+ }
146
+ ins {
147
+ text-decoration: none;
148
+ background-color: #d4fcbc;
149
+ }"""
148
150
149
151
def __init__ (self , source1 , source2 , accurate_mode ):
150
152
LOG .debug ('Initializing HTMLMatcher...' )
@@ -234,14 +236,14 @@ def out_delete(self, s, out):
234
236
if not s .strip ():
235
237
val = s
236
238
else :
237
- val = '' .join ((self .start_delete_text , s , self .end_span_text ))
239
+ val = '' .join ((self .start_delete_text , s , self .end_delete_text ))
238
240
out .write (bytes (val , 'utf-8' ))
239
241
240
242
def out_insert (self , s , out ):
241
243
if not s .strip ():
242
244
val = s
243
245
else :
244
- val = '' .join ((self .start_insert_text , s , self .end_span_text ))
246
+ val = '' .join ((self .start_insert_text , s , self .end_insert_text ))
245
247
out .write (bytes (val , 'utf-8' ))
246
248
247
249
def insert_stylesheet (self , html , stylesheet = None ):
0 commit comments