{# Render line-level styling for one unified-diff body (single file chunk). #} {% macro render_diff_body(text) %}
{% for line in text.splitlines() -%}
{%- if line.startswith('@@') -%}
{{ line }}
{%- elif line.startswith('+++') or line.startswith('---') or line.startswith('diff ') or line.startswith('index ') -%}
{%- elif line.startswith('+') -%}
{{ line }}
{%- elif line.startswith('-') -%}
{{ line }}
{%- else -%}
{{ line }}
{%- endif -%}
{% endfor %}
{% endmacro %}
{# Legacy: one blob (still works for patches without diff --git splits). #}
{% macro render_diff(text) %}