{#- An agreement's text, in its blocks: headings, paragraphs and list items, as `agreements::blocks` reads them. -#} {% macro text(blocks) -%}
{%- set ns = namespace(open=false) %} {%- for b in blocks %} {%- if b.kind == "item" and not ns.open %}{% set ns.open = false %}{% endif %} {%- if b.kind == "heading" %}

{{ b.text }}

{%- elif b.kind == "item" %}
  • {{ b.text }}
  • {%- else %}

    {{ b.text }}

    {% endif %} {%- endfor %} {%- if ns.open %}{% endif %}
    {%- endmacro %}