Spaces:
Sleeping
Sleeping
anmolsahai
commited on
Commit
•
9fbcde0
1
Parent(s):
93abebf
bug9
Browse files
app.py
CHANGED
@@ -38,14 +38,17 @@ def redline_changes(original_path, revised_path, output_path):
|
|
38 |
diff_doc = Document()
|
39 |
for line in diff:
|
40 |
if line.startswith('-'):
|
41 |
-
p = diff_doc.add_paragraph(
|
42 |
-
|
|
|
43 |
elif line.startswith('+'):
|
44 |
-
p = diff_doc.add_paragraph(
|
45 |
-
|
|
|
46 |
elif line.startswith('@@'):
|
47 |
-
p = diff_doc.add_paragraph(
|
48 |
-
|
|
|
49 |
else:
|
50 |
diff_doc.add_paragraph(line, style='Normal')
|
51 |
|
|
|
38 |
diff_doc = Document()
|
39 |
for line in diff:
|
40 |
if line.startswith('-'):
|
41 |
+
p = diff_doc.add_paragraph(style='Normal')
|
42 |
+
run = p.add_run(line)
|
43 |
+
run.font.color.rgb = RGBColor(255, 0, 0) # Red
|
44 |
elif line.startswith('+'):
|
45 |
+
p = diff_doc.add_paragraph(style='Normal')
|
46 |
+
run = p.add_run(line)
|
47 |
+
run.font.color.rgb = RGBColor(0, 128, 0) # Green
|
48 |
elif line.startswith('@@'):
|
49 |
+
p = diff_doc.add_paragraph(style='Normal')
|
50 |
+
run = p.add_run(line)
|
51 |
+
run.font.color.rgb = RGBColor(0, 0, 255) # Blue
|
52 |
else:
|
53 |
diff_doc.add_paragraph(line, style='Normal')
|
54 |
|