段落 {{ loop.index }}:
{% if pd.diff_type == DiffType.DELETE %}
{{ pd.old_para.text }}
{% elif pd.diff_type == DiffType.INSERT %}
{{ pd.new_para.text }}
{% elif pd.diff_type == DiffType.REPLACE %}
{% for seg in pd.text_diffs %}
{% if seg.diff_type == DiffType.EQUAL %}{{ seg.old_text }}{% elif seg.diff_type == DiffType.DELETE %}
{{ seg.old_text }}{% elif seg.diff_type == DiffType.INSERT %}
{{ seg.new_text }}{% elif seg.diff_type == DiffType.REPLACE %}
{{ seg.old_text }}{{ seg.new_text }}{% endif %}
{% endfor %}
{% endif %}
{% for fc in pd.format_changes %}
[格式] {{ fc.field }}: {{ fc.old_value }} → {{ fc.new_value }}
{% endfor %}
{% if pd.style_changed %}
[样式] {{ pd.old_style }} → {{ pd.new_style }}
{% endif %}
{% endif %}
{% endfor %}
{% if not has_para_change %}
{% if td.diff_type == DiffType.INSERT %}
新增表格 #{{ td.new_table_idx + 1 }}
{% elif td.diff_type == DiffType.DELETE %}
删除表格 #{{ td.old_table_idx + 1 }}
{% elif td.diff_type == DiffType.REPLACE %}
表格 #{{ td.old_table_idx + 1 }} 变更:
| 行 | 列 | 旧值 | 新值 |
{% for row, col, old_val, new_val in td.cell_diffs %}
| {{ row + 1 }} | {{ col + 1 }} | {{ old_val }} | {{ new_val }} |
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
{% set img_changes = [] %}
{% for im in diff.image_diffs %}{% if im.diff_type != DiffType.EQUAL %}{% if img_changes.append(im) %}{% endif %}{% endif %}{% endfor %}
{% if img_changes %}
{% if im.diff_type == DiffType.INSERT %}新增图片 ({{ im.content_type }})
{% elif im.diff_type == DiffType.DELETE %}删除图片 ({{ im.content_type }})
{% endif %}
{% endfor %}
{% endif %}