anchor }}{% endcapture %}
      {% endif %}
    {% endif %}

    {% capture new_heading %}
      <h{{ _hAttrToStrip }}
        {{ include.bodyPrefix }}
        {% if beforeHeading %}
          {{ anchor }}{{ header }}
        {% else %}
          {{ header }}{{ anchor }}
        {% endif %}
        {{ include.bodySuffix }}
      </h{{ _workspace | last }}
    {% endcapture %}
    {% capture edited_headings %}{{ edited_headings }}{{ new_heading }}{% endcapture %}
  {% endfor %}
{% endcapture %}{% assign head