{% assign to_remove = "`,~,!,@,#,$,%,^,&,*,(,),_,-,=,+,[,{,],},\,|,;,:,',<,>,." | split: "," %}
<div class="shadow accordion accordion-flush px-0" id="accordion-{{include.level}}-{{index_tag}}">
    {% for chapter in include.content %}

    {% assign tag = chapter.title | remove: " " | remove: "," | remove: """ %}
    {% for rem in to_remove %}
    {% assign tag = tag | remove: rem %}
    {% endfor %}

    {% assign index_tag = include.index.title | remove: " " | remove: "," | remove: """ %}
    {% for rem in to_remove %}
    {% assign index_tag = index_tag | remove: rem %}
    {% endfor %}

    <div class="accordion-item px-0" style="position: relative;">
        <h{{include.level}}
        class="accordion-header"
        id="heading-{{include.level}}-{{index_tag}}-{{tag}}">
        <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
                data-bs-target="#collapse-{{include.level}}-{{index_tag}}-{{tag}}"
                aria-expanded="false" aria-controls="collapse-{{include.level}}-{{index_tag}}-{{tag}}"
            {% if chapter.size <= 1 %}disabled{% endif %}
        >
        <span>{{chapter.title}}</span>
        </button>
        </h{{include.level}}>
        <div id="collapse-{{include.level}}-{{index_tag}}-{{tag}}" class="accordion-collapse collapse"
             aria-labelledby="heading-{{include.level}}-{{index_tag}}-{{tag}}">
            <div class="accordion-body py-0 m-0 border-box px-3 container-fluid rounded" >
                {% assign next_level = include.level | plus:1 %}
                {% include toc.html index=chapter level=next_level%}
            </div>
        </div>
    </div>
    {% endfor %}
</div>